-
Notifications
You must be signed in to change notification settings - Fork 29
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
vite with SSR: require is not defined #156
Comments
run |
Thanks @omridevk for your feedback. We still need to focus into the SSR story, would you like to tackle the problem? |
sure, it was quite easy to resolve this by using
and using |
@omridevk awesome 👏 I'm looking forward to testing your PR 🚀 |
@omridevk could you please post a PR or where to use your fix above. We seem to struggle with a simular problem =/ |
We are also facing the same problem in SvelteKit. It was working in version 0.2.8. see #163 |
Yes sorry, had to shift my focus on something else, hopefully will get to this, this week |
I couldn't find a workaround for this issue. I'm testing this with Remix app. |
@gioboa I was able to get the preview working, but I can't seem to be able to run tests, it is running into some memory issues, i'll add the logs later today |
|
@omridevk nice 👏 great |
Hello guys is there a develompoent on this issue ? because i have tried @omridevk solution in my app and i dont get the require is not defined message anymore but i'm having problems with the angular dependencies not being loaded. I'm using analog js for SSR wtih angular. |
No, there is no progression on this issue. feel free to contribute 😉 |
The package angular-architects/module-federation have added ssr support but their package is not compatible with vite. I'm trying to understand the changes they made and try to reproduce the same approach on this package since i'm having problems with the angular dependecies not exported.
I'm not sure of the cause of the error but maybe we can follow the changes they have done to make this module support ssr i'm using analog js as my host for testing ssr and the project can be found on github vite-module-federation-angular-test . Do you have any suggestions what can be the cause of this error in relation with ssr and module exports ? |
I did this example It's not working yet because this import from the host is never resolved ( no errors ) 😮💨
Any help is more than welcome. @RobinBomkamp helped with the SvelteKit example and he added few special edge checks for it here #206 |
@omridevk I tried the basic reproduction repo and I update the dependencies
It's working fine |
when using SSR, I am getting the following error:
see stackblitz for reproduction:
https://stackblitz.com/edit/github-ad1c93-e4uuvj?file=vite.config.ts,src/main.jsx,test.js
vite config:
The text was updated successfully, but these errors were encountered: