Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Build Fails for Payload CMS V3 (NextJS 15) using Nixpacks #4871

Closed
ardiansyaherwin opened this issue Jan 20, 2025 · 3 comments
Closed

Comments

@ardiansyaherwin
Copy link

ardiansyaherwin commented Jan 20, 2025

Hi, I’m encountering an error out of nowhere. I haven’t made any changes to the app configuration on Coolify, and it was working fine previously without any issues. I’ve tried redeploying the last successful commit, but the error persists.

  • PayloadCMS: 3.16.0
  • Next.JS: 15.1.3
  • Coolify: v4.0.0-beta.380
#14 1.533    ▲ Next.js 15.1.3
#14 1.533    - Environments: .env
#14 1.533    - Experiments (use with caution):
#14 1.533      · turbo
#14 1.534 
#14 1.611    Creating an optimized production build ...
#14 48.29 Failed to compile.
#14 48.29 
#14 48.29 ./node_modules/.pnpm/@payloadcms+richtext-lexical@3.16.0_56zbg2ckbv7td2vtd5tjfwij4y/node_modules/@payloadcms/richtext-lexical/dist/exports/client/index.js + 10 modules
#14 48.29 Unexpected end of JSON input
#14 48.29 
#14 48.29 ./node_modules/.pnpm/@payloadcms+ui@3.16.0_monaco-editor@0.51.0_next@15.1.3_react-dom@19.0.0_react@19.0.0__react@1_64egvumjd6j6zrwcjxqfvuchy4/node_modules/@payloadcms/ui/dist/exports/client/index.js + 17 modules
#14 48.29 Unexpected end of JSON input
#14 48.29 
#14 48.29 ./node_modules/.pnpm/@payloadcms+ui@3.16.0_monaco-editor@0.51.0_next@15.1.3_react-dom@19.0.0_react@19.0.0__react@1_64egvumjd6j6zrwcjxqfvuchy4/node_modules/@payloadcms/ui/dist/exports/shared/index.js + 20 modules
#14 48.29 Unexpected end of JSON input
#14 48.29 
#14 48.29 ./node_modules/.pnpm/@radix-ui+react-dialog@1.1.1_react-dom@19.0.0_react@19.0.0__react@19.0.0_types-react-dom@19.0_avnb5d3jq2ix72b5njlnbagaqm/node_modules/@radix-ui/react-dialog/dist/index.mjs + 23 modules
#14 48.29 Unexpected end of JSON input
#14 48.29 
#14 48.29 ./node_modules/.pnpm/@radix-ui+react-select@2.1.4_react-dom@19.0.0_react@19.0.0__react@19.0.0_types-react-dom@19.0_sberhcirv7c2urdmq2mktv3qnu/node_modules/@radix-ui/react-select/dist/index.mjs + 36 modules
#14 48.29 Unexpected end of JSON input
#14 48.29 
#14 48.29 
#14 48.29 > Build failed because of webpack errors
#14 48.48  ELIFECYCLE  Command failed with exit code 1.
#14 ERROR: process "/bin/bash -ol pipefail -c pnpm run build" did not complete successfully: exit code: 1
------
 > [10/12] RUN  pnpm run build:
48.29 
48.29 ./node_modules/.pnpm/@radix-ui+react-dialog@1.1.1_react-dom@19.0.0_react@19.0.0__react@19.0.0_types-react-dom@19.0_avnb5d3jq2ix72b5njlnbagaqm/node_modules/@radix-ui/react-dialog/dist/index.mjs + 23 modules
48.29 Unexpected end of JSON input
48.29 
48.29 ./node_modules/.pnpm/@radix-ui+react-select@2.1.4_react-dom@19.0.0_react@19.0.0__react@19.0.0_types-react-dom@19.0_sberhcirv7c2urdmq2mktv3qnu/node_modules/@radix-ui/react-select/dist/index.mjs + 36 modules
48.29 Unexpected end of JSON input
48.29 
48.29 
48.29 > Build failed because of webpack errors
48.48  ELIFECYCLE  Command failed with exit code 1.
------
 1 warning found (use docker --debug to expand):
 - UndefinedVar: Usage of undefined variable '$NIXPACKS_PATH' (line 18)
Dockerfile:25
--------------------
  23 |     # build phase
  24 |     COPY . /app/.
  25 | >>> RUN  pnpm run build
  26 |     
  27 |     
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm run build" did not complete successfully: exit code: 1
Deployment failed. Removing the new version of your application.

anyone knows any workarounds or is it a known bug?

Steps to Reproduce

  1. Fresh install Coolify
  2. Setup a new Github App and connect your repository
  3. Fill in necessary environment variables and domain configuration.
  4. Click deploy

Example Repository URL

No response

Coolify Version

v4.0.0-beta.380

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04.4 LTS

Additional Information

No response

@ardiansyaherwin ardiansyaherwin added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Jan 20, 2025
@3Nigma
Copy link

3Nigma commented Jan 20, 2025

Seeing this in v4.0.0-beta.382 as well

@Flowko
Copy link

Flowko commented Jan 21, 2025

some things you could try and see if it resolves your issue:

  • update payload and its dependecies to its latest version, they had an issue in one of the versions related to the editor
  • make sure you are using node 20 in coolify, if using nixpacks add this env variable to NIXPACKS_NODE_VERSION equal to 20 make it as build Variable
  • do a clean deploy with no cache

hopfully one of these should resolve your issue

@andrasbacsai
Copy link
Member

some things you could try and see if it resolves your issue:

  • update payload and its dependecies to its latest version, they had an issue in one of the versions related to the editor
  • make sure you are using node 20 in coolify, if using nixpacks add this env variable to NIXPACKS_NODE_VERSION equal to 20 make it as build Variable
  • do a clean deploy with no cache

hopfully one of these should resolve your issue

This! Make sure the node version matches the required one.

If these not solve your issue, reopen it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants