TS Error with Node Compatibility Buffer API?
According to the docs (https://developers.cloudflare.com/workers/runtime-apis/nodejs/buffer/), one should import the Buffer API like this:
However, I get the following TS error:
I'm pretty sure this is just a
tsconfig.json
problem, but I can't seem to figure it out.1 Reply
figured it out (how did i not check this before 🤦♂️ ):
1)
npm install @types/node
2) in tsconfig.json
, add "node/buffer"
to the types
array