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.

Build fails in payload cloud

default discord avatar
roguesherlock2 years ago
7
[2023-08-11T04:56:33]
│
[2023-08-11T04:56:33]
│ ! Node v18+ is not supported on this App Platform stack. Please visit our documentation for more information on supported versions and stacks: https://do.co/apps-buildpack-node
[2023-08-11T04:56:33]
│
[2023-08-11T04:56:33]
│ ERROR: failed to build: exit status 1
[2023-08-11T04:56:33]
│
[2023-08-11T04:56:33]
│
[2023-08-11T04:56:33]
│ For documentation on the buildpacks used to build your app, please see:
[2023-08-11T04:56:33]
│
[2023-08-11T04:56:33]
│ Node.js v0.3.6 https://do.co/apps-buildpack-node
[2023-08-11T04:56:33]
│
[2023-08-11T04:56:33]
│ ✘ build failed


It's a monorepo setup with payload cms and next js frontend. I use turbo repo and pnpm for monorepo if that helps



I think the main problem is that it uses older buildpack using Ubuntu 18.04 stack which only supports node version until 17.x I think. how do I customize that ?

  • discord user avatar
    denolfe
    2 years ago
    @347347358725570561

    You are correct. The platform does not support Node 18, yet. We're working with the underlying vendor on supporting Node 18 in the near future.



    In the meantime, you should be able to force a specific version of node by setting it in your package.json's

    engines

    . Docs here:

    https://docs.npmjs.com/cli/v9/configuring-npm/package-json#engines
  • default discord avatar
    roguesherlock2 years ago
    @967118574445547650

    I feel a bit uncomfortable using older node engines. node 16 is going to be eol in like few months. Besides I use monorepo with pnpm so it'd make it very difficult for me to switch engines.


    What else can I do?



    p.s. iirc digitial ocean and heroku buildpacks does support newer node versions?

  • discord user avatar
    denolfe
    2 years ago

    I have been in talks with DigitalOcean (our backing provider). They are currently working on an update to add 18.x to the platform.



    They support up to 17.x for now



    They only recently informed us that they would be adding support for 18.x, so they have not given us a timeline, unfortunately.

  • default discord avatar
    roguesherlock2 years ago
    @967118574445547650

    I temporarily switched to older node to see if it actually deploys but it looks like it doesn't support pnpm at all?


    [2023-08-11T18:26:04]
    │ ---> - yj
    [2023-08-11T18:26:04]
    │ ---> Getting Node version
    [2023-08-11T18:26:04]
    │ ---> Resolving Node version
    [2023-08-11T18:26:05]
    │ ---> Downloading and extracting Node v17.9.1
    [2023-08-11T18:26:08]
    │ ---> Parsing package.json
    [2023-08-11T18:26:09]
    │ ---> No file to start server
    [2023-08-11T18:26:09]
    │ ---> either use 'docker run' to start container or add index.js or server.js
    [2023-08-11T18:26:09]
    │ project does not contain a package manager lockfile
    [2023-08-11T18:26:09]
    │ Error: package-lock.json does not exist. Please commit either a package-lock.json or yarn.lock file to your repository and try again.
    [2023-08-11T18:26:09]
    │ ERROR: failed to build: exit status 1
    [2023-08-11T18:26:09]
    │
    [2023-08-11T18:26:09]
    │
    [2023-08-11T18:26:09]
    │ For documentation on the buildpacks used to build your app, please see:
    [2023-08-11T18:26:09]
    │
    [2023-08-11T18:26:09]
    │ Node.js v0.3.6 https://do.co/apps-buildpack-node
    [2023-08-11T18:26:09]
    │
    [2023-08-11T18:26:09]
    │ ✘ build failed


    man this really sucks. What are my other options right now? Should I just self host it? I'd really want to avoid doing devops right now if I can haha

  • discord user avatar
    denolfe
    2 years ago

    The heroku buildpacks don't support pnpm natively, unfortunately, you'll need to use yarn/npm to run your app. The buildpacks detect the package manager based upon lock files, so you may be able to spoof it by providing a yarn lock file.



    Really unfortunate, I agree. We're wanting to move our projects over to pnpm ourselves and will inevitably run into this.



    It's possible

    to write a custom Dockerfile to circumvent all of this, but I haven't done it myself - so I wouldn't feel comfortable pointing you that direction without knowing it was a for sure solution.

  • default discord avatar
    roguesherlock2 years ago
    @967118574445547650

    are you saying I can write a custom dockerfile and payload cloud would detect it and use it for building the app? if so can you point me where can I learn more about it?


    I'll timebox it and see if I can make it work. otherwise we'll see haha

  • discord user avatar
    denolfe
    2 years ago
    @347347358725570561

    Ah, scratch the Dockerfile idea. We'd need to make a tweak on our end to pass that value through to the app spec.



    I'd say if you can include a yarn.lock somehow, you may be able to get around all of this.



    I don't have a short-term solution for pnpm natively without incorporating yarn/npm somewhere in there, unfortunately.



    Definitely on the short list of priorities for the platform over the new few months, though.

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.