Does anyone know how to manage these errors? I am getting them while deploying the code. Seems to be easy but I have no idea. Thanks
[2024-01-08T18:31:56]
│ unhandledRejection Error: Build failed because of webpack errors
[2024-01-08T18:31:56]
│ at webpackBuildImpl (/workspace/node_modules/next/dist/build/webpack-build/impl.js:270:21)
[2024-01-08T18:31:56]
│ at async webpackBuild (/workspace/node_modules/next/dist/build/webpack-build/index.js:137:16)
[2024-01-08T18:31:56]
│ at async /workspace/node_modules/next/dist/build/index.js:619:121
[2024-01-08T18:31:56]
│ at async Span.traceAsyncFn (/workspace/node_modules/next/dist/trace/trace.js:105:20)
[2024-01-08T18:31:56]
│ at async build (/workspace/node_modules/next/dist/build/index.js:185:29) {
[2024-01-08T18:31:56]
│ code: 'WEBPACK_ERRORS'
[2024-01-08T18:31:56]
│ }
[2024-01-08T18:31:57]
│ error Command failed with exit code 1.
[2024-01-08T18:31:57]
│ info Visit
https://yarnpkg.com/en/docs/cli/runfor documentation about this command.
[2024-01-08T18:31:57]
│ info Visit
https://yarnpkg.com/en/docs/cli/runfor documentation about this command.
[2024-01-08T18:31:57]
│ error Command failed with exit code 1.
[2024-01-08T18:31:57]
│ building: exit status 1
[2024-01-08T18:31:57]
│ ERROR: failed to build: exit status 1
[2024-01-08T18:31:58]
│
[2024-01-08T18:31:58]
│
[2024-01-08T18:31:58]
│ For documentation on the buildpacks used to build your app, please see:
[2024-01-08T18:31:58]
│
[2024-01-08T18:31:58]
│ Node.js v0.3.6
https://do.co/apps-buildpack-node[2024-01-08T18:31:58]
│
[2024-01-08T18:31:58]
│ ✘ build failed
Hey
@1127767324456407161can you give me a rundown of the steps you took to get here?
I have built complete E-commerce site, everything works on a local environment. Just started deploying it on cloud, got some type errors but I have used "typescript: {
ignoreBuildErrors: true,
}," and it worked. Now I am stuck with these errors trying to figure it out
I was using this tutorial as a base for it
https://www.youtube.com/watch?v=3JUsg-WsU9o&ab_channel=JavaScriptMasteryWhere are you trying to deploy?
payloadcms
Are you trying to deploy on Payload Cloud?
yes
this is my project ID 658ee8c59a9f67163de4934f I've paid for the cloud as well :/
can I get some help payload team
...?
Thanks for sharing the project id, we're on it!
you can build locally? or just dev?
locally everything works
the problem is that Im pushing my code to git and I get the errors mentioned above when cloud is building it
any ideas?
not off the top of my head. Locally I would attempt to
rm -rf node_modules, run
yarnto install them again, and then
yarn buildYour build errors seem to indicate you may be missing a file in your repo
[2024-01-09 14:12:43] │ Creating an optimized production build ...
[2024-01-09 14:13:02] │ webpack built 1ac955d9f3a960b310f7 in 19826ms
[2024-01-09 14:13:02] │ webpack compiled successfully
[2024-01-09 14:13:07] │ Failed to compile.
[2024-01-09 14:13:07] │
[2024-01-09 14:13:07] │ ./src/app/(pages)/styleguide/media-block/page.tsx
[2024-01-09 14:13:07] │ Module not found: Can't resolve '../../../../../public/static-image.jpg'
[2024-01-09 14:13:07] │
[2024-01-09 14:13:07] │ https://nextjs.org/docs/messages/module-not-found
[2024-01-09 14:13:07] │
[2024-01-09 14:13:07] │ unhandledRejection Error: Build failed because of webpack errors
[2024-01-09 14:13:07] │ at webpackBuildImpl (/workspace/node_modules/next/dist/build/webpack-build/impl.js:275:21)
[2024-01-09 14:13:07] │ at async webpackBuild (/workspace/node_modules/next/dist/build/webpack-build/index.js:156:16)
[2024-01-09 14:13:07] │ at async /workspace/node_modules/next/dist/build/index.js:678:115
[2024-01-09 14:13:07] │ at async Span.traceAsyncFn (/workspace/node_modules/next/dist/trace/trace.js:105:20)
[2024-01-09 14:13:07] │ at async build (/workspace/node_modules/next/dist/build/index.js:185:29) {
[2024-01-09 14:13:07] │ code: 'WEBPACK_ERRORS'
[2024-01-09 14:13:07] │ }Can you check your repo on git and see if that file is there or not?
after yarn build
did that still getting the same error
just bunch of errors that dont make sense and code should perfectly work with it
omg
I've solved it
all good
thanks for the help tho
Hey
@1127767324456407161what was the solution?
I've used eslint-plugin-import to fix all the linting issues, including sorting the imports in my files.
ran 'yarn build' it worked and it worked for the cloud as well
but now I got new error where I cannot login or create an account on a deployed site
typescript: {
ignoreBuildErrors: true,
},
this really helped in next.config.js
I cannot login to Admit account Im getting this message "There was an error with the credentials provided. Please try again."
did you dump your local database and import it to your deployed instance?
How to do that?
If you're using cloud you should have access to your mongodb atlas connection string, the path to import/export is all mongo so you'd need to read up on how to do that i.e.
https://www.mongodb.com/docs/v2.4/core/import-export/all good with it Ive managed. Thanks
the last problem (I hope) is that I cannot upload images on the site. When I upload them via dashboard they just dont appear
Any ideas whats the issue?
- Do they show initially then disappear on next deploy?
- What does the network request in dev tools say when trying to load the image after attempting upload?
no
looks something like that and when I upload them again the image wont show up
What does the network request in dev tools say when trying to load the image after attempting upload?
Also, can you verify you have the payload cloud plugin in your payload config's plugin array?
Providing your upload collection config would also help
Star
Discord
online
Get dedicated engineering support directly from the Payload team.