at Function. (node:internal/modules/cjs/loader:1383:15)
at /vercel/path0/client/node_modules/next/dist/server/require-hook.js:57:36
at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
at Function.\_load (node:internal/modules/cjs/loader:1192:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Module. (node:internal/modules/cjs/loader:1463:12)
at mod.require (/vercel/path0/client/node_modules/next/dist/server/require-hook.js:68:28)
at require (node:internal/modules/helpers:147:16)
> Build failed because of webpack errors
Error: Command "npm run build" exited with 1
please help
Vercel Staff
Hi , welcome to the Vercel Community!
What happens when you run npm run build and vercel build commands locally? Can you run both and share the outcome here?
If possible, please share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.
hi ,
here an local build output:
Creating an optimized production build …
✓ Compiled successfully in 23.6s
Skipping validation of types
./src/app/global-error.tsx
4:3 Warning: ‘error’ is defined but never used. @typescript-eslint/no-unused-vars
./src/app/policy-wallet/page.js
2:8 Warning: ‘Link’ is defined but never used. @typescript-eslint/no-unused-vars
15:3 Warning: ‘Filter’ is defined but never used. @typescript-eslint/no-unused-vars
23:20 Warning: ‘setPolicies’ is assigned a value but never used. @typescript-eslint/no-unused-vars
./src/app/whatsapp/page.js
12:3 Warning: ‘X’ is defined but never used. @typescript-eslint/no-unused-vars
17:10 Warning: ‘isChatOpen’ is assigned a value but never used. @typescript-eslint/no-unused-vars
17:22 Warning: ‘setIsChatOpen’ is assigned a value but never used. @typescript-eslint/no-unused-vars
./src/components/footer-03/Footer.tsx
67:7 Warning: ‘stats’ is assigned a value but never used. @typescript-eslint/no-unused-vars
./src/components/logindemo.js
27:9 Warning: ‘auth’ is assigned a value but never used. @typescript-eslint/no-unused-vars
29:10 Warning: ‘loading’ is assigned a value but never used. @typescript-eslint/no-unused-vars
55:18 Warning: ‘err’ is defined but never used. @typescript-eslint/no-unused-vars
./src/components/user/auth/Register.tsx
1:10 Warning: ‘cn’ is defined but never used. @typescript-eslint/no-unused-vars
18:3 Warning: ‘className’ is defined but never used. @typescript-eslint/no-unused-vars
19:6 Warning: ‘props’ is defined but never used. @typescript-eslint/no-unused-vars
./src/components/user2/Footer.js
1:8 Warning: ‘Image’ is defined but never used. @typescript-eslint/no-unused-vars
3:8 Warning: ‘styles’ is defined but never used. @typescript-eslint/no-unused-vars
./src/redux/store.ts
6:15 Warning: ‘Store’ is defined but never used. @typescript-eslint/no-unused-vars
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules
at Function.<anonymous> (node:internal/modules/cjs/loader:1383:15)
at /vercel/path0/client/node_modules/next/dist/server/require-hook.js:57:36
at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
at Function.\_load (node:internal/modules/cjs/loader:1192:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Module.<anonymous> (node:internal/modules/cjs/loader:1463:12)
at mod.require (/vercel/path0/client/node_modules/next/dist/server/require-hook.js:68:28)
at require (node:internal/modules/helpers:147:16)
\> Build failed because of webpack errors
Error: Command "npm run build" exited with 1
Vercel Staff
I see. Can you share the package.json, next config and vercel.json here?
My first suggestion would be to remove all node_modules and reinstall everything. Update the packages to their latest patch version and see if this fixes.
We haven't heard back from you. If you're still stuck, feel free to share any updates, logs, or additional context that might help us assist you better!