Skip to content
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

Edge Runtime + Standard MySQL (@planetscale/database fetch failed) #1938

Open
natilusky opened this issue Jan 24, 2025 · 2 comments
Open

Edge Runtime + Standard MySQL (@planetscale/database fetch failed) #1938

natilusky opened this issue Jan 24, 2025 · 2 comments

Comments

@natilusky
Copy link

I’m trying to self-host Dub.co using Azure MySQL instead of PlanetScale. However, the code currently imports @planetscale/database, which expects a PlanetScale Data API over HTTP. When running locally, the Next.js app is using the Edge runtime, and it fails to connect to a normal MySQL port with the following repeated error:

Image

Steps to Reproduce

  1. Clone Dub repo
  2. Set DATABASE_URL="mysql://:@.mysql.database.azure.com:3306/?sslaccept=strict"
  3. pnpm dev
  4. Open http://localhost:8888
  5. Observe repeated fetch failed logs, and the app can’t connect to MySQL
Copy link

linear bot commented Jan 24, 2025

@Suksham-sharma
Copy link
Contributor

@natilusky,
The problem arises because the @planetscale/database library is designed specifically for PlanetScale which differs from a standard MySQL server connection. The Dub codebase includes some areas where it directly uses PlanetScale , thus making it incompatible with a standard MySQL .

To resolve this, you can set up a local PlanetScale development environment. If you don’t already have a PlanetScale account, you can refer to the Dub local development guide this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants