Giter Site home page Giter Site logo

Comments (7)

kikoanis avatar kikoanis commented on May 21, 2024 1

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.

kikoanis avatar kikoanis commented on May 21, 2024

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.

gregberge avatar gregberge commented on May 21, 2024

There is a problem in the promise, this is why you are getting that error. I will fix it.

from loadable-components.

kikoanis avatar kikoanis commented on May 21, 2024

Thank you for the quick fix. much appreciated.

from loadable-components.

gregberge avatar gregberge commented on May 21, 2024

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.

kikoanis avatar kikoanis commented on May 21, 2024

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.

antonybudianto avatar antonybudianto commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.