Next 14 with bun 1.0.7
Hey there I'm wondering if I may get some clarification on how to correctly configure my Railway.json
1. What is the proper type for
NIXPACKS_NO_CACHE
I'm assuming it should be a string value of "1" in this case?
2. When adding a nixPkgsArchive I'm not seeing the proper version get installed. I've tried a few things
1. I assumed that maybe because I was passing "bun" in nixPkgs that it was interferring with the isntallation of the pckgArchive
2. I tried both ways and no lucj
My assumption is that I'm not properly working with the cache. And ould appreciate any documentation you all may offer up so I may do may read up on it. Thanks!
Solution:Jump to solution
First of all thanks @Brody !
For anyone currently working with Bun/Next.js/Railway this might be helpful:
For me , builds with next.js kept failing, and I’ve tried everything a lot of different methods, and configurations ...
14 Replies
Project ID:
1835b3bd-c387-4d79-ace9-a0e10cb05feb
1835b3bd-c387-4d79-ace9-a0e10cb05feb
you spelt
nixPkgsArchive
wrong, its spelt nixpkgsArchive
@Brody must have been thrown off then sinceI get this error
I'm going to test it now and let you know.
funny, its spelt
nixpkgsArchive
in their docs, i say spelt but its just the casingGoing to give it a show, I appreciate the follow-up
I saw that you mentioned NIXPACKS_NO_CACHE=1 for skipping caching when using railway.toml
Would this be the case for the railway.json?
i havent tried setting that variable in a railway.json or even a nixpacks.toml, ive only ever set it in a service variable
I see!
though if i had to guess you should set it as a service variable instead, since its more so a variable used by the platform
Let me give that a shot too
if you dont have any luck, just swap the nixpacks stuff to its own nixpacks.toml config file
Amazing! Doing a write up right now
Solution
First of all thanks @Brody !
For anyone currently working with Bun/Next.js/Railway this might be helpful:
For me , builds with next.js kept failing, and I’ve tried everything a lot of different methods, and configurations
What worked was Brody’s solution to separate the nixplan from the railway.config into a nixpack.config
"nixpacksConfigPath": "apps/next/nixpacks.toml"
Notes:
passing in :nodejs_20 so builds work with next.js 14.0
Using the cmd bun run --cwd "apps/next" build
to path to the directory and then build from there. This will correctly link packages workspace:*
If builds are failing you might want to clean your bun.lockb from the root of your project
rm -f bun.lockb
then bun i
Successfully deploys 14 with bun 1.0.7happy to help 🙂