loadable-components: Typescript + SSR after build throws error: "loadable: SSR requires `@loadable/babel`, please install it"
I’ve scoped down my project into the following: https://github.com/krishnaglick/prod-build-test
Running the server with yarn start works fine, but if I build and run (yarn serve) then the error shows up. Any insight would be appreciated as to why things are working correctly within typescript, but not built-javascript.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 18 (2 by maintainers)
I managed to solve the issue. The problem was my wrapper for
loadablefunction. In order to fix this issue I needed to add Magic Comment.I was able to get this issue solved by setting JSX within my server’s tsconfig build to
preserve, and targetingesnext. I’m going to close this now but pings are welcome if someone gets stuck along a similar vein.Hi guys, I am using razzle for SSR using typescript and facing similar issue. would like to check how did you manage to hook tsconfig.json file separately for server and for client. Mine project has one and I keep it on root of a project. Please suggest. Here is a snapshot of an error -
**Invariant Violation: loadable: SSR requires
@loadable/babel-plugin, please install it64 | store.runSaga(sagas).done.then(() => { 65 | preloadedState = store.getState();
I have the same issue. I tried to combine TypeScript and Babel loaders (as showed here - https://github.com/smooth-code/loadable-components/issues/173), but I’m still getting the same error. Does anyone succeeded in launch SSR in TypeScript?