Skip to content
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(worker): preserve esmodule symbol for dynamic imports #354

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

20051231
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

iife inlined all dynamic imports but name tag is not preserved so it is not recognized by vue defineAsyncComponent correctly as an esmodule for all dynamic chunks such as pages / layouts.

Enabling the rollup option fixes the issue.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

nuxt/nuxt#14350

@danielroe danielroe changed the title [FIX] Preserve esmodule symbol for dynamic imports in nuxt ssr fix: preserve esmodule symbol for dynamic imports Jul 20, 2022
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Note: this also affects vercel-edge and netlify-edge (in addition to cloudflare) which will currently be broken without this fix.

@pi0 pi0 changed the title fix: preserve esmodule symbol for dynamic imports fix(worker): preserve esmodule symbol for dynamic imports Jul 20, 2022
@riderx
Copy link

riderx commented Jul 22, 2022

I tried to add the config in my nuxt app here LeducIT/captime-website@da09bdb
and still get issue at runtime in netlify-egde
Screenshot 2022-07-22 at 14 32 59
Screenshot 2022-07-22 at 14 33 13

I'm not sure that exactly related.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pi0
Copy link
Member

pi0 commented Jul 27, 2022

I couldn't test it but trust works. For the future fixes, it would be nice to link nitro PRs with minimal reproduction (of a nitro app) πŸ™πŸΌ

@pi0 pi0 merged commit 0cd5121 into nitrojs:main Jul 27, 2022
@marshallswain
Copy link
Contributor

Thank you. This solution fixed my cloudflare-deployed Nuxt app.

WinterYukky pushed a commit to WinterYukky/nitro that referenced this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants