Can I specify the bun version to use?

Anonymous
TRIAL

2 years ago

What version of bun is Railway using right now?

I'm having a deployment issue due to bcrypt:
Error: Cannot find module '/app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node'

The fix was released last week with v1.0.17:
https://github.com/oven-sh/bun/issues/4063#issuecomment-1851375848

3 Replies

Anonymous
TRIAL

2 years ago

c0958e3e-4cd8-4f89-9376-7c4003820f57


2 years ago

You can specify it via a nixpacks.toml file in your project

for example:

[phases.setup]
  nixpkgsArchive = '9c69bc8cae2f3b38536a50801961e2e62da13595'

this is for version 1.0.18


2 years ago

( )


2 years ago

yo fragly nice job


Anonymous
TRIAL

2 years ago

Solid, thank you!


2 years ago

No problem :)


a year ago

For future readers, you can also use the latest commit like so

[phases.setup]
    nixpkgsArchive = 'master'

isaac-hinman
PRO

a year ago

Where can I find the nix archives?

I need to pin to Bun 1.1.22. Bun still segfaults regularly with new releases, and I've found the best way to run it in prod is to pin to a version and manually upgrade every so often.



isaac-hinman
PRO

a year ago

OK, it seems the latest Bun version is v1.1.20, but I specifically had to upgrade from that version to v1.1.22 due to segfaults, so if I try to run my Bun application on Railway, it just segfaults

Will have to Dockerize in the end, anyways


a year ago

Please note we do not maintain Nix Packages, that is a separate entity that we have no affiliation with, we are simply using them as a package manager.

If you need cutting edge, for any language, on the majority of cloud container platforms, you will always need a Dockerfile.

There is no overhead to using a Dockerfile as a Dockerfile is what Nixpacks is actually generating behind the scenes for you.


xl0
HOBBY

a year ago

@brody any chance you could work with Nix to get the latest Bun into their packages? Yes we can make our own Docker files, but

1) Bun docker image is built without SIMD

2) It's more tedious that what you get on Vercel, which seems to be able to keep up with Bun development. They have 1.1.26 at the moment.


a year ago

No I'm sorry but thats not something we can do, Nix has their own maintainers for that, we are simply using them as a package manager.