You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, whenever I npm run build my Next.js app, I get a webpack error. This may be something to do with #129 but I'm not building with any local modules/dependancies.
wiktor@MANTIS:~/Development-Linux/workspacemodels$ npm run build
> workspacemodels@0.1.0 build
> next build
info - Loaded env from /home/wiktor/Development-Linux/workspacemodels/.env.local
warn - SWC minify release candidate enabled. https://nextjs.org/docs/messages/swc-minify-enabled
Generated 9 documents in .contentlayer
info - Checking validity of types
info - Creating an optimized production build
Failed to compile.
./node_modules/next-contentlayer/dist/hooks/useLiveReload.js
Module not found: Can't resolve 'react' in '/home/wiktor/Development-Linux/workspacemodels/node_modules/next-contentlayer/dist/hooks'
Import trace for requested module:
./node_modules/next-contentlayer/dist/hooks/index.js
./pages/about.jsx
./node_modules/next-contentlayer/dist/hooks/useMDXComponent.js
Module not found: Can't resolve 'react' in '/home/wiktor/Development-Linux/workspacemodels/node_modules/next-contentlayer/dist/hooks'
Import trace for requested module:
./node_modules/next-contentlayer/dist/hooks/index.js
./pages/about.jsx
./node_modules/next-contentlayer/dist/hooks/useMDXComponent.js
Module not found: Can't resolve 'react/jsx-runtime.js' in '/home/wiktor/Development-Linux/workspacemodels/node_modules/next-contentlayer/dist/hooks'
Import trace for requested module:
./node_modules/next-contentlayer/dist/hooks/index.js
./pages/about.jsx
./node_modules/next-contentlayer/dist/hooks/useMDXComponent.js
Module not found: Can't resolve 'react-dom' in '/home/wiktor/Development-Linux/workspacemodels/node_modules/next-contentlayer/dist/hooks'
Import trace for requested module:
./node_modules/next-contentlayer/dist/hooks/index.js
./pages/about.jsx
./node_modules/next-themes/dist/index.modern.js
Module not found: Can't resolve 'react' in '/home/wiktor/Development-Linux/workspacemodels/node_modules/next-themes/dist'
Import trace for requested module:
./pages/_app.js
> Build failed because of webpack errors
Hi @wiktor-jurek - thanks for opening this issue and providing a link to your repo. I've taken a brief look and it seems the problem is related to you patching the config.resolve.alias Webpack config - I assume for the sake of using Preact? However, I don't see any Preact deps installed.
Simply commenting out these lines in your next.config.js seemed to make the next build work for me.
In case you actually intend to use Preact, please refer to this issue #62.
Closing this issue for now but happy to re-open in case I misunderstood the situation.
Hi, whenever I
npm run build
my Next.js app, I get a webpack error. This may be something to do with #129 but I'm not building with any local modules/dependancies.Here are my packages:
And here's a repo link.
Any help very much appreciated!
The text was updated successfully, but these errors were encountered: