Comments (7)
Not sure if this change was necessary
if (!state || !state.children)
You may not have a component that needs to be lazy loaded
from loadable-components.
Having the same issue. I am guessing the tree traverse was not a success on server side. However, there was a change in the code that makes this fail ungracefully.
I think this line
if (!rootState.children) return null
should not just return null but a promise.
I believe this is due to a change in this line
I am not entirely sure but i think that line changed from
var ids = window[_constants.COMPONENT_IDS] || [];
to
const state = window[LOADABLE_STATE]
notice the fallback here as []
from loadable-components.
There is a problem in the promise, this is why you are getting that error. I will fix it.
from loadable-components.
Thank you for the quick fix. much appreciated.
from loadable-components.
Anyway if you got this error, you should have a SSR issue. Do you have a __LOADABLE_STATE__
in your HTML code?
from loadable-components.
I do, but it always returns an empty array. I think because I use react-router and error boundary component. It seems that I can't get the tree traverse working correctly. Will do more digging and see if I notice anything in your code. Thanks again.
from loadable-components.
I've __LOADABLE_STATE__
on the html, but still error
@neoziro , I think this line didn't check for empty object, the state is {}
from my debug result
from loadable-components.
Related Issues (20)
- problem with redial HOT 2
- How to change referencing external styles to preload mode
- What is the best way to prevent failure to load component or catch properly? HOT 7
- getting Uncaught TypeError: Failed to resolve module specifier HOT 1
- loadable/component Synchronously Load Component Failed with Error "Cannot convert undefined or null to object HOT 2
- SassError: Undefined variable HOT 1
- Inline Chunk injection HOT 2
- Not working with latest @loadable/server & @loadable/babel-plugin `v5.16.0` version HOT 4
- How to lazyload a hook? HOT 3
- Fallback behaviour HOT 1
- Main.js is rendered on every page even if I splitted each page into chunks with @loadable/component
- error in ./node_modules/@loadable/component/dist/loadable.esm.mjs HOT 9
- Why ChunkExtractor is required? HOT 3
- Is website sync with repo?
- If I am using react18, do I still need loadable-components HOT 6
- Add esbuild support HOT 3
- react-native-web SSR support HOT 1
- Loading state is always true on first render HOT 3
- Add query parameter support HOT 3
- SSR is broken for component v5.16.2+ HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loadable-components.