NodeJS compat not working
Hey there, i've just tried creating a worker and wanted to use the
pg
client for connections to hyperdrive, but now I'm getting the error The package "string_decoder" wasn't found on the file system but is built into node. Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility.
which I did, but it still won't work for some reason. What am I doing wrong?9 Replies
Put
node_compat
above [[kv_namespaces]]
Put
node_compat
under compatibility_date
Oh oopYeah
Hai kian
Same with
minify
, it won't be doing anything right now.Oh, I didnt know it was order sensitive
Thank you
Yeah, that's TOML for ya'... 😅
TOML tables (square brackets) only end at another table or end of file - so
[[hyperdrive]]
would inherit those two values.Ah okay, thanks for the explanation :D