-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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 support circular dependency #2258
Comments
FWIW I have seen circular module references work fine with vite SSR so there might be something deeper going on here. Also, it seems a bit weird that you'd be requiring code for SSR that does TypeORM stuff -- are you using TypeORM on the client? If not, you may be able to get around your issue by requiring only the code that needs to go out to the client through vite SSR. |
@airhorns I wrote a plugin https://github.com/axe-me/vite-plugin-node for using vite as node dev server. Even for SSR, some vue projects using VuexORM etc will also have similar issue. |
Dev SSR circular dependencies don't work in a very simple example. SPA works, final SSR build works too.
|
Describe the bug
When loading an SSR module with circular dependency (Many to many relationships TypeORM entities for example), the cli is stuck.
And sometime I get the Circular dependency: warning, sometimes I don't.
To be honest, I'm not sure this is a bug, lots of backend code written in this pattern. In my opinion, circular dependency should be allowed for SSR. But I'm not sure how can you patch the modGraph with circular dependency in it.
Reproduction
https://github.com/axe-me/repro-vite-circular-dependency
System Info
vite
version: 2.0.3Logs (Optional if provided reproduction)
The text was updated successfully, but these errors were encountered: