Hi there, it seems like the library doesn't work on Cloudflare even with the compatibility flags in wrangler.toml:
compatibility_flags = ["nodejs_compat_v2"]
Steps to reproduce:
- Clone this repo: https://github.com/vladinator1000/cf-qrcode
- Run
npm start
- Go to
localhost:8787
I can see that toBuffer is clearly exported from https://github.com/soldair/node-qrcode/blob/master/lib/server.js#L106
I wonder if the issue is due to the bundling process. When I enumerate the package keys like this
import QRCode from 'qrcode';
export default {
async fetch(request, env, ctx): Promise<Response> {
return new Response(Object.keys(QRCode));
},
} satisfies ExportedHandler<Env>;
I get
create,toCanvas,toDataURL,toString
Hi there, it seems like the library doesn't work on Cloudflare even with the compatibility flags in wrangler.toml:
compatibility_flags = ["nodejs_compat_v2"]Steps to reproduce:
npm startlocalhost:8787I can see that
toBufferis clearly exported from https://github.com/soldair/node-qrcode/blob/master/lib/server.js#L106I wonder if the issue is due to the bundling process. When I enumerate the package keys like this
I get