Repository navigation
Fix main on Nuxt 4: CSS minify error and CSP-blocked import map - #241
Merged
Merged
Conversation
Dependabot's #240 moved Nuxt from 3 to 4, and main broke twice: - The build failed: Nuxt 4 minifies CSS with Lightning CSS, which stops at tachyons' old IE hacks (`*zoom: 1`). Error recovery drops them. - Once built, no script ran: Nuxt 4 loads the app through an inline <script type="importmap">, and build-csp only hashed classic and module scripts, so the enforced CSP blocked the map ("Failed to resolve module specifier #entry") and every page stayed static. Import maps are now hashed too, with a test. The Android touch suite caught the second one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
darkmastermindz
pushed a commit
that referenced
this pull request
Oct 24, 2026
…rt map) Same change as #241, so this branch builds and runs on main's Nuxt 4 (from #240). It no-ops once #241 is merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
This was referenced Oct 24, 2026
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.
Summary
Main is broken. Dependabot's security group update (#240) moved Nuxt from 3.x to 4.6.2, and every Netlify deploy since has failed: main's, and the previews for #230 and #231. There are two separate problems:
.cf{*zoom:1}):SyntaxError: [lightningcss minify] Unexpected end of input<script type="importmap">that maps#entryto the entry chunk.scripts/lib/csp.mjsonly hashed classic and module inline scripts, so the enforced Content-Security-Policy blocked the import map.Failed to resolve module specifier "#entry"and stayed static HTML: no coin, no cards, no navigation scripts.Related Issue
None. Found while checking #230's failed deploy preview, after #240 was merged.
Changes Made
nuxt.config.js:vite.css.lightningcss.errorRecovery: true, so the minifier drops the old IE hacks instead of failing. No modern browser reads them anyway.scripts/lib/csp.mjs:inlineScriptHashesalso hashestype="importmap". Browsers applyscript-srcto inline import maps.tests/security/headers.test.mjs: a new test checks that inline import maps are hashed, whatever the case of thetypeattribute.Testing
450882e:npm run generatefails with the Lightning CSS error.npm test: 221 pass.npm run generatesucceeds: Nuxt 4.6.2, Vite 8.3.5, 16 pages.build-cspnow allows 2 inline scripts by hash (the payload script and the import map).640e4e1) and this branch, pixel by pixel./,/bio,/blog,/projects,/gear/outdoorand/terms, on desktop (1280px) and a Pixel 7.Additional Information
tailwindcss/nesting could not be loaded: Tailwind's utilities are still generated (checked in the built CSS).Duplicated imports "MAX_TEXT": two utils each export aMAX_TEXTconstant used only inside its own file.Generated by Claude Code