Error using Mysql2 with Vite

I'm trying to use Mysql2 with Vite + React Router but some poly fills seem to not work correctly for me. When importing in mysql2 in any file it fails to load wiht the error
buffer.hasOwnProperty is not a function
buffer.hasOwnProperty is not a function
Im using this compatabiltity date and flag:
"compatibility_date": "2025-04-08",
"compatibility_flags": ["nodejs_compat"],
"compatibility_date": "2025-04-08",
"compatibility_flags": ["nodejs_compat"],
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?