{"record":{"id":"591ec43871e92d75","repo":"instructure/canvas-lms","slug":"fingerprint-not-found-bundle-path-variant","errorCode":null,"errorMessage":"Fingerprint not found. #{bundle_path} #{variant}","messagePattern":"Fingerprint not found\\. #(.+?) #(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/brandable_css.rb","lineNumber":317,"sourceCode":"    # template is rendered at runtime\n    def handlebars_index_json\n      if defined?(ActionController) && ActionController::Base.perform_caching && defined?(@handlebars_index_json)\n        return @handlebars_index_json\n      end\n\n      file = APP_ROOT.join(CONFIG.dig(\"indices\", \"handlebars\", \"path\"))\n      unless file.exist?\n        raise \"#{file.expand_path} does not exist. You need to run `yarn run build:css` before you can serve css.\"\n      end\n\n      @handlebars_index_json = file.read.rstrip\n    end\n\n    # bundle path should be something like \"bundles/speedgrader\" or \"plugins/analytics/something\"\n    def cache_for(bundle_path, variant)\n      key = [\"#{bundle_path}.scss\", variant].join(CONFIG[\"manifest_key_seperator\"])\n      fingerprint = combined_checksums[key]\n      raise \"Fingerprint not found. #{bundle_path} #{variant}\" unless fingerprint\n\n      fingerprint\n    end\n\n    def all_fingerprints_for(bundle_path)\n      variants.index_with do |variant|\n        cache_for(bundle_path, variant)\n      end\n    end\n  end\nend\n","sourceCodeStart":299,"sourceCodeEnd":329,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/brandable_css.rb#L299-L329","documentation":"cache_for looks up a css fingerprint for a (bundle_path, variant) pair in the combined_checksums manifest keyed by '<bundle>.scss<separator>variant'. If the key is absent — the bundle isn't in the built manifest for that variant — it raises 'Fingerprint not found'. Callers like all_fingerprints_for will propagate this.","triggerScenarios":"brandable_css.cache_for('bundles/speedgrader', 'new_styles_normal') where the scss file isn't listed in the bundles_with_deps manifest for that variant (typo'd bundle path, plugin bundle not built, new bundle added without rebuilding).","commonSituations":"Adding a new .scss bundle and serving without rebuilding css; renaming an scss file while old code still references the old path; plugin css not compiled in the deploy.","solutions":["Run yarn run build:css so the new/renamed bundle is included in the checksums manifest","Correct the bundle_path string in the calling code to match the actual scss file path (key is built as \"#{bundle_path}.scss\")","Confirm the plugin/account css bundle is part of the build globs","Check the variant name matches an actual variant in CONFIG['variants']"],"exampleFix":"// before\nBrandableCSS.cache_for(\"bundles/speedgradeer\", \"new_styles_normal\") # typo\n// after\nBrandableCSS.cache_for(\"bundles/speedgrader\", \"new_styles_normal\")","handlingStrategy":"fallback","validationCode":"key = \"#{bundle_path}.scss\"\nraise 'unknown bundle' unless BrandableCSS.combined_checksums.key?([key, variant].join(sep))","typeGuard":null,"tryCatchPattern":"begin\n  BrandableCSS.cache_for(bundle_path, variant)\nrescue RuntimeError => e\n  raise unless e.message.start_with?('Fingerprint not found')\n  Rails.logger.warn(\"unknown css bundle #{bundle_path}\")\n  nil\nend","preventionTips":["Reference bundle paths from constants, not hand-typed strings","Rebuild css whenever adding or renaming scss files","List variants from CONFIG['variants'] instead of hardcoding"],"tags":["ruby","css","manifest","fingerprint"],"backgroundTag":"resource-not-found","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}