-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix(nuxt): pass output.generatedCode.symbols: true
to nitro for rolldown-vite
#32358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(nuxt): pass output.generatedCode.symbols: true
to nitro for rolldown-vite
#32358
Conversation
|
@nuxt/kit
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #32358 will not alter performanceComparing Summary
|
WalkthroughThe change updates the 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/nuxt/src/core/nitro.ts (1)
239-246
: Add test for dynamic import workaroundYou've introduced
output.generatedCode.symbols: true
to fix dynamic import resolution per Vue core issue #8351. To guard against future regressions, please add an integration test or fixture that verifies dynamic imports of statically imported modules now load correctly on the server. I’m happy to help draft this test.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/nuxt/src/core/nitro.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: test-fixtures (windows-latest, built, webpack, async, manifest-on, json, 20)
- GitHub Check: test-fixtures (windows-latest, built, rspack, default, manifest-on, json, 20)
- GitHub Check: test-fixtures (windows-latest, built, rspack, async, manifest-on, json, 20)
- GitHub Check: test-fixtures (windows-latest, built, vite, async, manifest-off, json, 20)
- GitHub Check: test-fixtures (windows-latest, dev, vite, default, manifest-off, json, 20)
- GitHub Check: test-fixtures (windows-latest, built, vite, default, manifest-off, json, 20)
Co-authored-by: Alexander Lichter <github@lichter.io>
I tried using this solution but still SSR is broken when using cloudflare-module nitro preset |
I guess it's vitejs/rolldown-vite#248 |
Hi @sapphi-red can you point me to a direction how to apply neutral platform when building nuxt? |
🔗 Linked issue
refs #30654
refs #31812
📚 Description
Rolldown currently does not inline dynamic imports that imports statically imported modules (rolldown/rolldown#4905). This is the feature in rollup that requires Nuxt to set
output.generatedCode.symbols: true
as a workaround for vuejs/core#8351.Because Rolldown does not inline dynamic imports, Nitro (which uses Rollup) sees that and inlines them. However, since
output.generatedCode.symbols: true
is not set for Nitro's Rollup build, the generated code encounters vuejs/core#8351. This leads to a test failure due to an import error on server side for this component:nuxt/test/fixtures/basic/app/pages/lazy-import-components/index.vue
Line 4 in 017d1be
Because I didn't find any problems with setting
output.generatedCode.symbols: true
for normal Vite, I've added it unconditionally.