Repository navigation
hotfix: 1.6.1 - #112
Merged
Merged
hotfix: 1.6.1#112
Conversation
The production build failed with 'Prism is not defined': the Home page rendered no content and no docs page showed its code panel. The grammars in prismjs/components call a global Prism, and the bundler does not guarantee that the core publishes it first. A small prism-global module sets it explicitly before any grammar is imported. Checked on the built site: Home and all 21 docs sections render, and every code panel is highlighted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a production bug in release 1.6.0.
Problem
The built site failed with
ReferenceError: Prism is not defined. The Home page showed only the nav and footer. No docs page showed its code panel. The dev server hid the problem, because it loads modules in a different order.Cause
The language grammars in
prismjs/componentscall a globalPrism. The redesign dropped the step that publisheswindow.Prismfirst. The bundler does not guarantee that the core runs before a side-effect import.Fix
A new module,
src/lib/prism-global.ts, setsglobalThis.Prismand is imported first byprism-setup.ts. This restores the approach from commit 3ba7d20.Checked on the production build
Follow-up
CI only checks that the build succeeds. It does not load the built site, so it could not catch this. A smoke test that opens the built Home page would catch it.