Replies: 2 comments
-
Hmm, it looks like the node addons are pretty specific to the node runtime. In the short term, it seems like using other libraries to replace The offending one will be the way to go for me. I might look into creating another argon2 library out of the original rust library that compiles to wasm and can be easily integrated into a worker. |
Beta Was this translation helpful? Give feedback.
-
Node.js native add-ons are likely never to be supported by workers, for many reasons that aren't worth delineating. You can explore options of compiling those to webassembly as an alternative but the options there are limited. |
Beta Was this translation helpful? Give feedback.
-
Not sure if this is the right place to ask about this, but I was hoping to get some insight about whether
.node
binaries are currently supported by the workers/pages platform, or if they will be in the future.I am developing a website for a class project and wanted to use lucia auth. There were some build issues and after some investigation, I found that the issue is that lucia auth depends on @node-rs/argon2 (among others), which is rust code distributed as a node addon with the
.node
extension. After fixing some esbuild errors in our project and in the cloudflare adapter for sveltekit, I got it working locally, but deployment to pages fails. I know workers already supports rust compiled to wasm via workers-rs, so I thought there might be a chance this could work after putting in a bit of effort to get it packaged correctly.This assignment isn't required to be deployed, so if this isn't possible right now it's not too big of a deal, but if a solution or workaround exists I want to find it. If necessary, I could probably cut out/replace the offending dependencies.
Shameless plug: Want me to investigate further and try to get
.node
binaries working with the workers platform or something similar? I'm still looking for an internship this summer and would love to both learn about and help develop cutting edge web technologies at cloudflare.Beta Was this translation helpful? Give feedback.
All reactions