-
-
Notifications
You must be signed in to change notification settings - Fork 630
Fails to run on Cloudflare Pages/Workers #3460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, @alexcroox! Could you share a self-contained reproduction of this error using |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Apologies it must have been a red herring that including mysql2 caused the error. Perhaps it activated some bundling in Nitro that triggered the error Either way if it's not used by this lib then nothing you can do. Thanks for looking and pointing me towards npm ls! Edit: safe-buffer is used by |
I've opened an issue here for anyone else that might be experiencing the same troubles: nitrojs/nitro#3170 |
Workaround for Nitro users:
In a future release |
@alexcroox, thanks for your dedication in bringing the solution here too 🤝 |
Reopening because I think it's worth mentioning it in the documentation. Please, feel free to contribute 🙋🏻♂️ |
Anyone know is this bug or wrong configuration? Sometime works perfectly fine and sometime got 500 with:
|
I was very excited to try this on Cloudflare pages/workers, unfortunately it fails to run with the following:
I've tracked it down to the
safe-buffer
dependancy.mysql2 3.13.0
└─┬ iconv-lite 0.6.3
└── safer-buffer 2.1.2
It looks like this was reported a couple of years ago: ChALkeR/safer-buffer#7
I've narrowed down my project and it only triggers this error when the
'mysql2/promise'
is imported.It runs fine locally with node just not with wrangler locally or on CF remotely. I've tried deploying to both pages and workers with Nitro.js
The text was updated successfully, but these errors were encountered: