Worker not finding module when "node:" prefix is used

I'm trying to import an npm module, but if I try to import it with the "node:" prefix as the docs say, I get a "no such module" error. If I remove the "node:" prefix though it is able to find the module but then of course it has compatibility issues, so I assume this isn't what I want. How should I be importing the module? I have enabled nodejs_compat in my wrangler.toml file
2 Replies
James
James8mo ago
Can you share a minimal example of what you're trying to do? You should only be using the node: prefix for node built-ins, like node:crypto, etc.
LeftyLlama
LeftyLlamaOP8mo ago
Ah got it, I interpreted it as needing that prefix on all node modules
Want results from more Discord servers?
Add your server