Dynamic require of "node:buffer" is not supported

Hey All!

Trying to follow along with the dev doc guide on browser rendering within workers. However I am getting an error when attempting to dev test or deploy.

notes: [
      {
        text: 'Uncaught Error: Dynamic require of "node:buffer" is not supported\n' +
          '  at worker.js:13:11\n' +
          '  at worker.js:944:28\n' +
          '  at worker.js:14327:3\n' +
          ' [code: 10021]'
      }
    ],


import puppeteer from "@cloudflare/puppeteer";
import { Buffer } from 'node:buffer';
globalThis.Buffer = Buffer;


main = "src/index.js"
compatibility_date = "2023-03-14"
compatibility_flags = [ "nodejs_compat" ]

browser = { binding = "MYBROWSER" }
Was this page helpful?