Closed fmartins-andre closed 3 years ago
+1, have the same issue. My stack is based on Razzle.
I manage to solve this problem using "magic-comments". https://loadable-components.com/docs/babel-plugin/#magic-comments
@bartlomn , please try this approach and tell us your results.
Hey @fmartins-andre ❤️ Thanks for the suggestion. For clarity, here's what worked for me:
const Component = loadableInViewport(/* #__LOADABLE__ */ () => import('../Component'));
Great! I think this solves this problem, then. I'm closing this issue now, but I think that would be useful if the maintainer could mention this kind of situation in the README.md file!
@tazsingh
I'm using it with:
when I run gatsby build it crash with this error message:
I then installed the
@loadable/babel-plugin
package but I had no luck! The error continues to trigger! There's no error if I remove the react-loadable-visibility call from the code.Any ideas?