I am following the tutorial on building a serverless function here: https://developers.cloudflare.com/workers/tutorials/build-a-serverless-function
I’m at the point of requiring the
qr-image package. I have it installed and referenced in
However, when I publish with Wrangler to test the results, I get the following:
The line being referenced is the same line from the tutorial:
const qr = require('qr-image')
I’ve browsed around the documentation but can’t understand why this is. It seems perhaps I have to integrate webpack with the worker so it compiles all modules required into a bundle, but it’s not clear how that works with Cloudflare Workers.
Appreciate any help!