Uncaught ReferenceError: Buffer is not defined
Hello
I'm getting the following error:
I have added
compatibility_flags = [ "nodejs_compat" ]
and am importing node:buffer
.
Does anyone have any other suggestions?
Thanks and kind regards1 Reply
I’d give this a read: https://blog.cloudflare.com/more-npm-packages-on-cloudflare-workers-combining-polyfills-and-native-code they recently released V2 of Node compat, but you’ll need to potentially bring your compatibility date forward (depending when you created your worker) - and pretty sure there’s no need for the node: prefix on V2
The Cloudflare Blog
More NPM packages on Cloudflare Workers: Combining polyfills and na...
Workers now supports more NPM packages and Node.js APIs using an overhauled hybrid compatibility layer.