Closed lifeart closed 3 years ago
reproduction app: https://github.com/lifeart/_glimmerx-apollo-ssr-issue
steps in readme section: https://github.com/lifeart/_glimmerx-apollo-ssr-issue#how-to-check
@lifeart After a bit of trial and error, I saw that Vite is not using conditional exports correctly when doing SSR.
If you change the import to import 'glimmer-apollo/dist/cjs/environment-glimmer';
, you will note that for the most part, it will work. After the SSR page is served, then we get the error for the client not finding the module. There were a few issues/prs in Vite around this problem, but they seem to be resolved/closed.
I did find another issue when running in node using Vite, a PR for that is coming: ReferenceError: self is not defined
.
closing, it, proposed solution (straightforward import) works just fine!
@josemarluedke thank you for your findings here and support!
I got this if trying to render glimmerx app in ssr mode:
I see environment resolution problems in SSR mode, especially,
import 'glimmer-apollo/environment-glimmer'
not working in nodejs (module not found), looks like it should be bundled to support nodejs execution or such