Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Does anyone know how to manage these errors? I am getting them while deploying the code.

default discord avatar
reziiix_232682 years ago
21

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/run

for documentation about this command.


[2024-01-08T18:31:57]


│ info Visit

https://yarnpkg.com/en/docs/cli/run

for 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

  • discord user avatar
    seanzubrickas
    2 years ago

    Hey

    @1127767324456407161

    can you give me a rundown of the steps you took to get here?

  • default discord avatar
    reziiix_232682 years ago

    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=JavaScriptMastery
  • discord user avatar
    seanzubrickas
    2 years ago

    Where are you trying to deploy?

  • default discord avatar
    reziiix_232682 years ago

    payloadcms

  • discord user avatar
    seanzubrickas
    2 years ago

    Are you trying to deploy on Payload Cloud?

  • default discord avatar
    reziiix_232682 years ago

    yes



    this is my project ID 658ee8c59a9f67163de4934f I've paid for the cloud as well :/



    can I get some help payload team



    ...?

  • default discord avatar
    paulpopus2 years ago

    Thanks for sharing the project id, we're on it!

  • discord user avatar
    jarrod_not_jared
    2 years ago
    @1127767324456407161

    you can build locally? or just dev?

  • default discord avatar
    reziiix_232682 years ago

    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?

  • discord user avatar
    jarrod_not_jared
    2 years ago

    not off the top of my head. Locally I would attempt to

    rm -rf node_modules

    , run

    yarn

    to install them again, and then

    yarn build
  • discord user avatar
    denolfe
    2 years ago

    Your 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?

  • default discord avatar
    reziiix_232682 years ago

    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

  • discord user avatar
    seanzubrickas
    2 years ago

    Hey

    @1127767324456407161

    what was the solution?

  • default discord avatar
    reziiix_232682 years ago

    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."

  • discord user avatar
    seanzubrickas
    2 years ago

    did you dump your local database and import it to your deployed instance?

  • default discord avatar
    reziiix_232682 years ago

    How to do that?

  • discord user avatar
    seanzubrickas
    2 years ago

    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/
  • default discord avatar
    reziiix_232682 years ago

    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?

  • discord user avatar
    denolfe
    2 years ago

    - 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?

  • default discord avatar
    reziiix_232682 years ago

    no



    looks something like that and when I upload them again the image wont show up

  • discord user avatar
    denolfe
    2 years ago
    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 on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.