backpack icon indicating copy to clipboard operation
backpack copied to clipboard

Dynamic import

Open mxstbr opened this issue 7 years ago • 1 comments

Importing my code-split React app gives me this annoying error:

screen shot 2017-09-27 at 6 21 29 pm

Using react-loadable for the code splitting etc. Looking at razzle it should just be a matter of adding babel-plugin-syntax-dynamic-import to the Babel config?

https://github.com/jaredpalmer/razzle/blob/75966e3eb6177657c066a44b97e63870f5fa5eeb/packages/babel-preset-razzle/index.js#L21-L22

mxstbr avatar Sep 27 '17 16:09 mxstbr

Hmm, using syntax-dynamic-import breaks (?) server-side rendering with react-loadable. I'm seeing the loading indicator be rendered on the server, even with the import-inspector plugin and serverSideRequirePath enabled.

cc'ing @thejameskyle, he might have a clue what's going on here!

mxstbr avatar Sep 27 '17 16:09 mxstbr