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

SSR web worker build with noExternal: true omit dynamic imports #9385

Closed
7 tasks done
fcomrqz opened this issue Jul 27, 2022 · 3 comments · Fixed by #9401
Closed
7 tasks done

SSR web worker build with noExternal: true omit dynamic imports #9385

fcomrqz opened this issue Jul 27, 2022 · 3 comments · Fixed by #9401
Labels
p4-important Violate documented behavior or significantly improves performance (priority) regression The issue only appears after a new release

Comments

@fcomrqz
Copy link

fcomrqz commented Jul 27, 2022

Describe the bug

I am trying to update a SSR Vue app to vite@3.0.3 and deploy to a Cloudflare Worker.

On Cloudflare I'm getting a warn:
"[Vue warn]: Component <Anonymous> is missing template or render function."

On client side I'm getting an hydration error.

Works properly on dev mode.

As far as I understand the issue is related to missing dynamic imports in the server bundle.

Cloudflare Workers don't support dynamic imports. 😕

I reproduce the behavior on StackBlitz.

Screen Shot 2022-07-26 at 6 52 30 p m

Am I doing something wrong?

Reproduction

https://stackblitz.com/edit/node-tmtkzw

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.10 - /bin/yarn
    npm: 7.17.0 - /bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^3.0.1 => 3.0.1 
    vite: ^3.0.3 => 3.0.3

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

You are importing App.vue and mounting that. But that's an empty file.
This is the reason why it's not working.

@sapphi-red sapphi-red added invalid This doesn't seem right and removed pending triage labels Jul 27, 2022
@fcomrqz
Copy link
Author

fcomrqz commented Jul 28, 2022

Hi @sapphi-red

I forgot to add the router-view to App.vue.

I do it and I still get the dynamic imports out of the SSR bundle.

As I understand noExternal: true should embed all modules in the bundle.

With vite@2.9.14 works

https://stackblitz.com/edit/node-hq9vb8

@sapphi-red sapphi-red removed the invalid This doesn't seem right label Jul 28, 2022
@sapphi-red sapphi-red reopened this Jul 28, 2022
@sapphi-red sapphi-red added the p4-important Violate documented behavior or significantly improves performance (priority) label Jul 28, 2022
@sapphi-red
Copy link
Member

Ah, sorry this condition was wrong.
3b41a8e#diff-aa53520bfd53e6c24220c44494457cc66370fd2bee513c15f9be7eb537a363e7R450

@sapphi-red sapphi-red added the regression The issue only appears after a new release label Jul 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p4-important Violate documented behavior or significantly improves performance (priority) regression The issue only appears after a new release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants