loadable-components: Uncaught TypeError: Cannot read property 'Symbol(loadable)' of undefined

Problem occurs while I work with server render and dynamic client code from webpack. Seems I have difference in module numbers when HMR recompile my client code. Server rendering works throw babel-node and don’t need webpack build.

/* eslint-env browser */
function loadComponents() {
  if (typeof window === 'undefined') {
    throw new Error('`loadComponents` must be called client-side: `window` is undefined');
  }

  var ids = window[_constants.COMPONENT_IDS] || [];
  return Promise.all(ids.map(function (id) {
    return componentTracker.get(id)[_constants.LOADABLE]().load(); // error here
  }));
}

HTML contains IDS <script>window.__LOADABLE_COMPONENT_IDS__ = [6553];</script>

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23 (12 by maintainers)

Most upvoted comments

A disclamer about this in README.md could save some time and headaches