worker-template-mysql icon indicating copy to clipboard operation
worker-template-mysql copied to clipboard

Error occuring: Uncaught ReferenceError: FinalizationRegistry is not defined

Open Badestrand opened this issue 2 years ago • 6 comments

Hi

After resolving this issue I ran into the next one. My barebones worker throws the exception:

 ⛅️ wrangler 2.10.0 
--------------------
Your worker has access to the following bindings:
- Vars:
⬣ Listening at http://0.0.0.0:8787
- http://127.0.0.1:8787
- http://192.168.43.230:8787
Total Upload: 223.96 KiB / gzip: 62.20 KiB
✘ [ERROR] Error on remote worker: ParseError: A request to the Cloudflare API (/accounts/e18730c578d8a62bbaf31c7a65b3344f/workers/scripts/script-name/edge-preview) failed.

      at throwFetchError
  (/Users/.../node_modules/wrangler/wrangler-dist/cli.js:123634:17)
      at fetchResult
  (/Users/.../node_modules/wrangler/wrangler-dist/cli.js:123603:5)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async createPreviewToken
  (/Users/.../node_modules/wrangler/wrangler-dist/cli.js:125631:29)
      at async createWorkerPreview
  (/Users/.../node_modules/wrangler/wrangler-dist/cli.js:125651:17)
      at async start
  (/Users/.../node_modules/wrangler/wrangler-dist/cli.js:128131:34)
  {
    text: 'A request to the Cloudflare API
  (/accounts/e18730c578d8a62bbaf31c7a65b3344f/workers/scripts/script-name/edge-preview)
  failed.',
    notes: [
      {
        text: 'Uncaught ReferenceError: FinalizationRegistry is not defined\n' +
          '  at index.js:342:28\n' +
          ' [code: 10021]'
      }
    ],
    location: undefined,
    kind: 'error',
    code: 10021
  }


╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open Devtools, [l] turn on local mode, [c] clear console, [x] to exit                                                                                                   │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

It seems to relate to this issue which basically says "not supported".

So can I conclude that this package here doesn't work and it is not possible to connect to MySQL from a Cloudflare Worker?

Edit: To clarify, it seems that this error is originating from the wasm of this package.

Badestrand avatar Feb 21 '23 14:02 Badestrand