Can't use binary dependencies in api endpoints

Hi, i'm currently using the "@node-rs/argon2" package in a trpc api being exposed as an endpoint via solidstart, and when I try to build the app, I get the following error:
ERROR [commonjs--resolver] ../../node_modules/.pnpm/@node-rs+argon2-darwin-arm64@2.0.2/node_modules/@node-rs/argon2-darwin-arm64/argon2.darwin-arm64.node (1:0): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
ERROR [commonjs--resolver] ../../node_modules/.pnpm/@node-rs+argon2-darwin-arm64@2.0.2/node_modules/@node-rs/argon2-darwin-arm64/argon2.darwin-arm64.node (1:0): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
Is there some way I can specify "@node-rs/argon2" as an external dependency to not be bundled, and just manually include it in node_modules in my (node22) docker image? Thanks!
1 Reply
Stefan
StefanOP2w ago
If anyone has this same issue in the future, I ended up solving it by pulling solidstart out of my stack, and refactoring to use this template I made https://github.com/Kyritec/solidjs-hono-starter
GitHub
GitHub - Kyritec/solidjs-hono-starter: A starter project for using ...
A starter project for using solidjs and hono together. - Kyritec/solidjs-hono-starter

Did you find this page helpful?