Docker build failed Next.js
I am looking to deploy my next.js app on railway. I've added environment variables, added railway.toml file to root and I am still getting a docker failed error. It seems to be that there is a space after ENV on line 12 but not sure how to correct that? I dont have docker or access to that file. here is a copy of the build log:
project id: 7a7981e0-b081-4941-8efd-d9c6a55d5383
31 Replies
Project ID:
7a7981e0-b081-4941-8efd-d9c6a55d5383
Looks like discord auto corrected the error and turned it into an unamused emoji. I believe it is supposed to be ENV=$ but there is an added space before the assignment operator
enclose it in triple backticks
edit your original message
yea caught that sorry haha
do you have a service variable with a blank name?
negative
and I checked for added spaces before and after
can you show me the variables you do have? (just the variable names)
thats it?
correct
try deploying your repo in a new railway service
That seemed to get it past that issue though now I am running into a nope version compatability, Next.js requires at least version >= 18 and looks like 16.18.1 is whats avaialble?
set
engines.node
to 18
in your package.json
should I specify the 18.17.0 version?
no, only specifying major versions is supported
setting it to 18 still has the version compatibility conflict
what version is being used
18.12.1
iv'e tried other major versions and they all revert back to version 16, is this going to be a stopper?
other major versions?
seems that the latest version is 21? at least when I installed node locally anyway
show me your package.json with
engines.node
set to 21
pleaseokay and show me the build table from the latest build using that package.json
show me the build table from the latest build using that package.json please
sorry what does that refence?
the build table, at the top of the logs
youre on an old version of nixpacks, why?
ah that was from the railway.toml file. was added that due to a past helpdesk question. I removed it and it looks like it built successfully
thank you!
no problem!