how to get better-sqlite3 to work in docker
hello. I'm getting this error when trying to run a t3 app with better-sqlite3, which I'm using with lucia auth to run and I tried using a newer node alpine image (18 and 21). The error is very similar to the one reported here https://github.com/TryGhost/node-sqlite3/issues/1581
any help would be appreciated.
GitHub
Prebuilt Binaries from 5.0.3 causing errors in node:16-alpine docke...
I have a node app running in a node:16-alpine docker image, and the application starts fine, but when it tries to load sqlite and use it, I get the following stack trace: node:internal/modules/cjs/...
6 Replies
the issue is related to alpine
and the c bindings
you either try go handle on the docker image
Solution
or move to a debian based image for example
thanks! I'll try chaning to a debian based image and report back. I was using an alpine based one per this example https://github.com/vercel/next.js/tree/canary/examples/with-docker
GitHub
next.js/examples/with-docker at canary · vercel/next.js
The React Framework. Contribute to vercel/next.js development by creating an account on GitHub.
it's an issue with alpine and sqlite
I think that may have helped, since I'm getting a new error!
this is weird that I'm only seeing this issue when building but not running in dev mode
I just updated it and am now getting this error:
the last issue was fixed by deleting
node_modules
and reinstalling it. Thanks again, @nyx (Rustular DevRel) !