•In patients with biliary tract cancer, KRAS variants were significantly associated with poor prognosis. This evidence concerns the gene KRAS and biliary tract cancer.