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 + 5.2 + SSR Bug

See original GitHub issue

🐛 Bug Report

5.2.1 CRA.2.1+SSR+Typescript throws the following error { Invariant Violation: loadable: SSR requires @loadable/babel, please install it at invariant (/Users/example-project/node_modules/@loadable/component/dist/loadable.cjs.js:13:15) at new InnerLoadable (/Users/example-project/node_modules/@loadable/component/dist/loadable.cjs.js:131:9) at processChild (/Users/example-project/node_modules/react-dom/cjs/react-dom-server.node.development.js:2748:14) at resolve (/Users/example-project/node_modules/react-dom/cjs/react-dom-server.node.development.js:2714:5) at ReactDOMServerRenderer.render (/Users/example-project/node_modules/react-dom/cjs/react-dom-server.node.development.js:3098:22) at ReactDOMServerRenderer.read (/Users/example-project/node_modules/react-dom/cjs/react-dom-server.node.development.js:3057:29) at renderToStaticMarkup (/Users/example-project/node_modules/react-dom/cjs/react-dom-server.node.development.js:3539:27) at process (/Users/example-project/node_modules/react-apollo/react-apollo.umd.js:129:24) framesToPop: 1, name: 'Invariant Violation' }

To Reproduce

Steps to reproduce the behavior:

https://github.com/followbl/loadable-components/tree/bug-ssr-loadable in the examples SSR repo of loadable-components yarn && yarn run build:web && yarn run build:server

Expected behavior

At a minimum it should say the correct plugin to install @loadable/babel-plugin…however, even with the plugin installed, I’m still running in to the above error. If you comment out the loadable components in loadable-components/examples/server-side-rendering/src/client/routes.tsx and load the vanilla ones, it works fine. This very well could be an issue you in ts-loader or my tsconfig…but I have spent over a day on this bug and cannot think of what else might be causing this

Link to repl or repo (highly encouraged)

https://github.com/followbl/loadable-components/tree/bug-ssr-loadable

Run `npx envinfo --system --binaries --npmPackages

yarn && yarn run build:web && yarn run build:server

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
followblcommented, Dec 11, 2018

@neoziro as soon as I have a working solution I will gladly update a fully working TypeScript example. Thanks for loadable-components and your attentiveness to users of this OSS 👍

1reaction
usamakamran1commented, Feb 3, 2019

Using ts-loader and babel-loader together in webpack worked for me. Had to change the current build process for my project but certainly worth it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript + 5.2 + SSR Bug · Issue #173 - GitHub
Bug Report 5.2.1 CRA.2.1+SSR+Typescript throws the following error { Invariant Violation: loadable: SSR requires @loadable/babel, ...
Read more >
85 - Stack Overflow
I understand this is a simple issue and an error that I am making but however, I have not been able to resolve...
Read more >
React Typescript TEMPLATE (usePortal react-select bug ...
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >
Bountysource
Typescript + 5.2 + SSR Bug. ... footer-logo. Help and Information. Frequently Asked Questions · Bugs and Feature Requests · Fees. Company.
Read more >
Swiper Changelog
Bug Fixes. angular: autoplay SSR (4f1e9c4); angular: don't enable observer when virtual enabled (8810b18) ... 5.2.0 - Released on October 26th, 2019.
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