question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript + SSR after build throws error: "loadable: SSR requires `@loadable/babel`, please install it"

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mciastekcommented, Apr 5, 2019

I managed to solve the issue. The problem was my wrapper for loadable function. In order to fix this issue I needed to add Magic Comment.

2reactions
krishnaglickcommented, Mar 29, 2019

I was able to get this issue solved by setting JSX within my server’s tsconfig build to preserve, and targeting esnext. I’m going to close this now but pings are welcome if someone gets stuck along a similar vein.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript + SSR after build throws error: "loadable ... - GitHub
I have issue both with only babel-loader (babel-typescript preset) and with ts-loader + babel-loader.
Read more >
SSR requires `@loadable/babel-plugin`, please install it ...
I'm using the loadable component in a ReactJS project. For SSR but I get the following error when I run start command, I...
Read more >
Server Side Rendering - Loadable Components
1. Install @loadable/babel-plugin .babelrc. { · 2. Install @loadable/webpack-plugin. webpack.config.js · 3. Setup ChunkExtractor server-side. import { ...
Read more >
Server-Side Rendering - Vite
Building for Production​​ To ship an SSR project for production, we need to: Produce a client build as normal; Produce an SSR build,...
Read more >
@loadable/babel-plugin | Yarn - Package Manager
This plugin is required only if you use Server Side Rendering in your application. See @loadable/server for more information. Install. npm install --save-dev...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found