René's URL Explorer Experiment


Title: MySQL void/db crashes in workerd dev: mysql2 imported by absolute path bypasses the dep optimizer · Issue #410 · voidzero-dev/void · GitHub

Open Graph Title: MySQL void/db crashes in workerd dev: mysql2 imported by absolute path bypasses the dep optimizer · Issue #410 · voidzero-dev/void

X Title: MySQL void/db crashes in workerd dev: mysql2 imported by absolute path bypasses the dep optimizer · Issue #410 · voidzero-dev/void

Description: Summary With the MySQL dialect, void/db crashes under vp dev (the workerd runtime) with: ReferenceError: require is not defined at runInRunnerObject (workers/runner-worker/index.js) Postgres is not affected. Cause The virtual void/db mod...

Open Graph Description: Summary With the MySQL dialect, void/db crashes under vp dev (the workerd runtime) with: ReferenceError: require is not defined at runInRunnerObject (workers/runner-worker/index.js) Postgres is not...

X Description: Summary With the MySQL dialect, void/db crashes under vp dev (the workerd runtime) with: ReferenceError: require is not defined at runInRunnerObject (workers/runner-worker/index.js) Postgres is not...

Opengraph URL: https://github.com/voidzero-dev/void/issues/410

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MySQL void/db crashes in workerd dev: mysql2 imported by absolute path bypasses the dep optimizer","articleBody":"## Summary\n\nWith the MySQL dialect, `void/db` crashes under `vp dev` (the workerd runtime) with:\n\n```\nReferenceError: require is not defined\n    at runInRunnerObject (workers/runner-worker/index.js)\n```\n\nPostgres is not affected.\n\n## Cause\n\nThe virtual `void/db` module imports `mysql2` by absolute file path (`packages/void/src/plugin-drizzle.ts`):\n\n```ts\nconst mysql2Resolved = fileURLToPath(import.meta.resolve('mysql2')); // line 19\n// ...\nimport { createPool } from ${JSON.stringify(mysql2Resolved)};   // line 159\n```\n\n`mysql2/index.js` is CommonJS only. Vite redirects only bare specifiers to prebundled deps (`tryOptimizedResolve`). An absolute path skips the dep optimizer, so workerd gets the raw CommonJS file. This happens whether `void` is installed or workspace-linked, because the resolved path is always under `node_modules`.\n\nAdding `optimizeDeps.include: ['void > mysql2', 'void > mysql2/promise']` doesn't help. Both get prebundled, but the virtual module still imports the unconverted file.\n\nPostgres works because its virtual module imports bare `\"pg\"` (line 201), which gets discovered and prebundled. Later `import('pg')` calls from Void's runtime then reuse that copy.\n\nOther places that dynamically import `mysql2/promise` from Void's dist and are probably affected too:\n- `runtime/better-auth-mysql.ts`\n- `runtime/migration-handler-mysql.ts`\n\n## Reproduction\n\n1. Copy `playground/pg-test`, switch it to `database: 'mysql'` with a `mysqlTable` schema, and set `DATABASE_URL` in `.env`.\n2. Run `vp dev` and request a route that runs `db.select().from(users)`.\n3. The response is 500 `ReferenceError: require is not defined`. With the pg dialect, the same app gets as far as a connection error.\n\n## Suggested fix\n\n- Emit `import { createPool } from \"mysql2\"` in dev, and map it to `mysql2Resolved` only at build time, as already done for `pg`.\n- Add `void > mysql2` and `void > mysql2/promise` to the workerd `optimizeDeps.include` list from #407.\n- Cover a MySQL `void/db` route in dev, either in packed-consumer or in an integration test.\n\nFound while reviewing #407 (its description mentions mysql2 as a possible case).\n","author":{"url":"https://github.com/Brooooooklyn","@type":"Person","name":"Brooooooklyn"},"datePublished":"2026-10-12T10:11:05Z","url":"https://github.com/voidzero-dev/void/issues/410"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dde5d8a9-3d38-e8ec-1412-a2c530ef935d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC278:321782:50E148:6E5EA7:6AFBA032
html-safe-noncea4b797d6a7f9a1651e83b7a09e094389a2eccd7ba5b0bdacb19f623d359bbddb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjc4OjMyMTc4Mjo1MEUxNDg6NkU1RUE3OjZBRkJBMDMyIiwidmlzaXRvcl9pZCI6Ijg3NjIwNDQyNzEzMzE4NzY5MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace492ae404ce12004b8e412f712032161e4d8804522dba95a7c16412d3144c2c0
hovercard-subject-tagissue:5811985004
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/voidzero-dev/void/410/issue_layout
twitter:imagehttps://opengraph.githubassets.com/76fa61308a43a3bdfca6a7a3d13d39af5643adfd75bd37beefa767f7377b1697/voidzero-dev/void/issues/410
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/76fa61308a43a3bdfca6a7a3d13d39af5643adfd75bd37beefa767f7377b1697/voidzero-dev/void/issues/410
og:image:altSummary With the MySQL dialect, void/db crashes under vp dev (the workerd runtime) with: ReferenceError: require is not defined at runInRunnerObject (workers/runner-worker/index.js) Postgres is not...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameBrooooooklyn
hostnamegithub.com
expected-hostnamegithub.com
None3cefd19a936819d82cfb5279d50fb56fe79cb9ec30f0f807e04e89b0c58ffae1
turbo-cache-controlno-preview
go-importgithub.com/voidzero-dev/void git https://github.com/voidzero-dev/void.git
octolytics-dimension-user_id149750581
octolytics-dimension-user_loginvoidzero-dev
octolytics-dimension-repository_id1164437080
octolytics-dimension-repository_nwovoidzero-dev/void
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1164437080
octolytics-dimension-repository_network_root_nwovoidzero-dev/void
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release606800bdb1b81d125fc845bdcc262c9fe063fc8f
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/voidzero-dev/void/issues/410#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvoidzero-dev%2Fvoid%2Fissues%2F410
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvoidzero-dev%2Fvoid%2Fissues%2F410
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=voidzero-dev%2Fvoid
Reloadhttps://github.com/voidzero-dev/void/issues/410
Reloadhttps://github.com/voidzero-dev/void/issues/410
Reloadhttps://github.com/voidzero-dev/void/issues/410
voidzero-devhttps://github.com/voidzero-dev
voidhttps://github.com/voidzero-dev/void
Codehttps://github.com/voidzero-dev/void
Issues29 (29)https://github.com/voidzero-dev/void/issues
Pull requests10 (10)https://github.com/voidzero-dev/void/pulls
Discussionshttps://github.com/voidzero-dev/void/discussions
Actionshttps://github.com/voidzero-dev/void/actions
Security and qualityhttps://github.com/voidzero-dev/void/security
Insightshttps://github.com/voidzero-dev/void/pulse
https://github.com/voidzero-dev/void
New issuehttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/410
New issuehttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/410
#413https://github.com/voidzero-dev/void/pull/413
MySQL void/db crashes in workerd dev: mysql2 imported by absolute path bypasses the dep optimizerhttps://github.com/voidzero-dev/void/issues/410#top
#413https://github.com/voidzero-dev/void/pull/413
bugSomething isn't workinghttps://github.com/voidzero-dev/void/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/Brooooooklyn
Brooooooklynhttps://github.com/Brooooooklyn
on Oct 12, 2026https://github.com/voidzero-dev/void/issues/410#issue-5811985004
fix(email): convert email-validator for installed Void worker runtimes in dev #407https://github.com/voidzero-dev/void/pull/407
#407https://github.com/voidzero-dev/void/pull/407
Brooooooklynhttps://github.com/Brooooooklyn
bugSomething isn't workinghttps://github.com/voidzero-dev/void/issues?q=state%3Aopen%20label%3A%22bug%22
on Oct 12, 2026https://github.com/voidzero-dev/void/issues/410#event-33037495389
Brooooooklynhttps://github.com/Brooooooklyn
completedhttps://github.com/voidzero-dev/void/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
b58300fhttps://github.com/voidzero-dev/void/commit/b58300ff84cfdd29ae66557640903613435e872f
on Oct 14, 2026https://github.com/voidzero-dev/void/issues/410#event-33218436162
Sign up for freehttps://github.com/signup?return_to=https://github.com/voidzero-dev/void/issues/410
Sign in to commenthttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/410
bugSomething isn't workinghttps://github.com/voidzero-dev/void/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.