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

cloudflare worker SSR issue due to bundling config problem #14350

Closed
20051231 opened this issue Jul 19, 2022 · 0 comments · Fixed by nuxt/framework#7389
Closed

cloudflare worker SSR issue due to bundling config problem #14350

20051231 opened this issue Jul 19, 2022 · 0 comments · Fixed by nuxt/framework#7389
Assignees

Comments

@20051231
Copy link

Environment

nitropack@0.4.12
nuxt@3.0.0-rc.6

Reproduction

NITRO_PRESET=cloudflare pnpm build
npx miniflare .output/server/index.mjs --site .output/public

Describe the bug

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.

Any SSR request will just render an empty page with following warning.

[Vue warn]: Component <Anonymous> is missing template or render function.

Enabling this rollup config in nitro presets fixes the issue.
base-worker.ts

const baseWorker = defineNitroPreset({
  entry: null,
  node: false,
  minify: true,
  noExternals: true,
  rollupConfig: {
    output: {
      format: "iife",
+      generatedCode: {
+        symbols: true,
+      }
    },
  },
  inlineDynamicImports: true
});

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants