Next Js pages breaking with dynamic imports #24739
Labels
bug
Issue was opened via the bug report template.
please add a complete reproduction
The issue lacks information for further investigation
What version of Next.js are you using?
latest
What version of Node.js are you using?
v10.24.0
What browser are you using?
chrome
What operating system are you using?
macOs
How are you deploying your application?
other
Describe the Bug
{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"err":{"name":"ModuleBuildError","message":"Module build failed (from ./node_modules/next/dist/build/webpack/loaders/next-babel-loader.js):\nTypeError [ERR_INVALID_ARG_TYPE]: /repo/components/Redeem/RedeemWrapper.tsx: The \"from\" argument must be of type string. Received type undefined\n at validateString (internal/validators.js:125:11)\n at relative (path.js:1162:5)\n at Import (/repo/node_modules/next/dist/build/babel/plugins/react-loadable-plugin.js:25:840)\n at NodePath._call (/repo/node_modules/next/dist/compiled/babel/bundle.js:2194:84530)\n at NodePath.call
Getting this error. Works fine on dev server.
Expected Behavior
Build is passing but page is breaking.
To Reproduce
Dynamic import code is below
const LinkStoreCardWrapper = dynamic(() => import('@components/Redeem/LinkStoreCard/LinkStoreCardWrapper'));
Attached screen shot.
Sometimes it does not render anything on page. Although the build is successful and the application is running.
The text was updated successfully, but these errors were encountered: