Hi,
I am running Deno Fresh and npm:mysql2. I have a simple API route that inserts a row into the db. When I run the Fresh server in development mode, I get the following error:
00~error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'allocUnsafe')
at Object.<anonymous> (file:///Users/pan/Library/Caches/deno/npm/registry.npmjs.org/mysql2/3.5.0/lib/commands/query.js:13:50)
at Object.<anonymous> (file:///Users/pan/Library/Caches/deno/npm/registry.npmjs.org/mysql2/3.5.0/lib/commands/query.js:323:4)
at Module._compile (node:module:718:36)
at Object.Module._extensions..js (node:module:737:12)
at Module.load (node:module:652:34)
at Function.Module._load (node:module:534:16)
at Module.require (node:module:671:23)
at require (node:module:771:20)
at Object.<anonymous> (file:///Users/pan/Library/Caches/deno/npm/registry.npmjs.org/mysql2/3.5.0/lib/commands/index.js:5:15)
at Object.<anonymous> (file:///Users/pan/Library/Caches/deno/npm/registry.npmjs.org/mysql2/3.5.0/lib/commands/index.js:29:4)01~
However, when I simply start Fresh in produciton mode, everything works fine. I tried reproducing the issue and just copying the database related bits into separate files and running it. It worked fine, and the issue seems to happen when I run the Fresh server in development mode only.
Any thoughts? The error points to the Buffer global being used (Buffer.allocUnsafe). This is weird since this shouldn't happen in Deno
Thank you for your time.