W
Wasp•3mo ago
Zuck

I think my wasp build dockerfile node 20 is overriding my github actions node version

This hasnt happened before, but in my github action for deploying to fly i set node to 22.0.0. But i think my wasp build docker file which shows node as 20.0.0 is overriding that. This is causing an error for sharp because it needs node 22.0.0. But its weird because my build deploys fine from my github action but then i see the error in the fly server logs
12 Replies
MEE6
MEE6•3mo ago
Wohooo @Zuck, you just became a Waspeteer level 9!
kapa.ai
kapa.ai•3mo ago
Hi @Zuck. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information in the knowledge sources, Wasp has historically required specific Node.js versions, typically the latest LTS (e.g., Node 18), and only recently started relaxing this requirement to allow Node.js >= 18 in newer releases. However, there is no explicit documentation in the sources about how the Node.js version is set in the Dockerfile generated by Wasp, nor about how it interacts with the Node.js version set in your GitHub Actions workflow. From your description, it sounds like your GitHub Actions workflow uses Node 22.0.0, but the Dockerfile generated by Wasp for deployment (e.g., to Fly.io) is using Node 20.0.0. This would explain why your build passes in CI (using Node 22), but fails at runtime on Fly.io (using Node 20), especially for dependencies like sharp that require Node 22. The knowledge sources do not provide details on customizing the Node.js version in the Wasp-generated Dockerfile. They do mention that Wasp's requirements have been strict in the past, but are being relaxed to allow newer Node versions, and that there have been issues with Node version mismatches between development and deployment environments Relax node version requirements of Wasp?, Upgrade Node version requirement to 20. Summary:
- The Node.js version in your Dockerfile is likely set by Wasp and may not match your GitHub Actions version. - This mismatch can cause runtime errors if your app or dependencies require a newer Node version than what is in the Dockerfile. - The knowledge sources do not provide a documented way to override the Node.js version in the Wasp Dockerfile. Recommendation:
You may need to manually edit the Dockerfile generated by Wasp to use Node 22.0.0, or check if a newer version of Wasp allows you to configure this. If this is not currently supported, consider opening an issue or feature request with the Wasp team. I'm sorry I can't provide a more specific solution, as the knowledge sources do not contain explicit instructions for customizing the Dockerfile's Node.js version. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Zuck, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Zuck
ZuckOP•3mo ago
@kapa.ai give me the info again for customizing docker file there is a way, i create it in my main folder and then i just have duplicate the node line and change the verison right
kapa.ai
kapa.ai•3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Yes, you can customize the Dockerfile that Wasp uses for building your server. To do this, create your own Dockerfile in your project's root directory (the same directory as your main.wasp file). When Wasp finds a Dockerfile in the root, it will append its contents to the bottom of the default multi-stage Dockerfile that it generates. If you want to change the Node.js version, you can duplicate the relevant FROM line from the generated Dockerfile and modify it to use your desired Node version (e.g., Node 22). Since the last definition in a Dockerfile wins, your custom FROM line will override the previous one. Key points: - Place your custom Dockerfile in the project root. - Add or override the FROM node:... line with your desired Node version. - Make sure to supply ENTRYPOINT in your final build stage if you override stages. - The generated Dockerfile's content can change with Wasp updates, so review it periodically. For more details, see the official Wasp documentation:
Customizing the Dockerfile ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Zuck, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Zuck
ZuckOP•3mo ago
figured it out this is all happening because Vite 7.0.0 came out i dont know whats happening im still getting it so much is going wrong
Carlos
Carlos•3mo ago
hey @Zuck I don't think I really understood what the problem was, how does Vite 7 fit into this?
Zuck
ZuckOP•3mo ago
@Carlos you can close this as well, vite 7 required a different node version and then i kept getting errors through switching. I think i always needed a custom dockerfile to override my wasp build node version. I thought my github workflow was doing it in fly but i guess it wasnt.
miho
miho•3mo ago
@Carlos I guess we'd want to pin our Vite version from now on? 😄
Vinny (@Wasp)
Vinny (@Wasp)•3mo ago
yeah I just tried starting an app and got this error:
[ Client!] npm ERR! engine Unsupported engine
[ Client!] npm ERR! engine Not compatible with your version of node/npm: vite@7.0.0
[ Client!] npm ERR! notsup Not compatible with your version of node/npm: vite@7.0.0
[ Client!] npm ERR! notsup Required: {"node":"^20.19.0 || >=22.12.0"}
[ Client!] npm ERR! notsup Actual: {"npm":"10.2.3","node":"v20.10.0"}
[ Client!]
[ Client!] npm ERR! engine Unsupported engine
[ Client!] npm ERR! engine Not compatible with your version of node/npm: vite@7.0.0
[ Client!] npm ERR! notsup Not compatible with your version of node/npm: vite@7.0.0
[ Client!] npm ERR! notsup Required: {"node":"^20.19.0 || >=22.12.0"}
[ Client!] npm ERR! notsup Actual: {"npm":"10.2.3","node":"v20.10.0"}
[ Client!]
Filip
Filip•3mo ago
I tried reproducing it with: - node 20 + basic template - node 22 + basic template - node 20 + open saas - node 22 + open saas What I did: - wasp new - wasp start db - wasp db migrate-dev - wasp start But couldn't get the errors. Any tips on reproducing the problem? @Zuck Can you tell me how to reproduce this if you're around? I can't seem to get it broken
Zuck
ZuckOP•3mo ago
@Filip that’s because I believe you need sharp installed. First as @Vinny (@Wasp) points out above 👆 vote 7 requires different node requirements than 6. Second, sharp requires or has a bug on a decent amount of docker node versions in 20.0.0 I can’t remember exactly. Then prisma and argon2 have bugs on a bunch of alpine releases of node 20. All very confusing and was hard to debug and to clarify this was happening in fly server AFTER deployment 😂 so I think had to do with the dockerfiles requirements for node more than anything. Which is why bullseyeslim worked more than anything • Node 20 .19 (Vite 7 requirement) • Debian 11 (bullseye-slim, OpenSSL 1.1) • Flexible npm install (no lock-sync errors) • Prisma & argon2 native rebuild
Filip
Filip•3mo ago
Thanks for the detailed info @Zuck! Turns out that Wasp was broken for older versions of node 20 (like e.g., 20.10) I believe I fixed this (at least for the time being) with Wasp 0.16.7 (just released). But I see you got the issue sorted out by using Node 20.19.

Did you find this page helpful?