mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #184] vinext build fails in CI (GitHub Actions): Dynamic require of @cloudflare/vite-plugin not supported in ESM context #40
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @justinfinnn on GitHub (Feb 28, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/184
Bug
vinext buildfails in GitHub Actions (Ubuntu runner) with:Environment
Steps to reproduce
vite.config.tsusing@cloudflare/vite-pluginvinext buildin a GitHub Actions CI environment (ubuntu-latest, Node 22)Root cause
The
vite.config.tsgenerated/used by vinext imports@cloudflare/vite-pluginvia CommonJSrequire(). In Node 22's strict ESM context on Linux CI runners, dynamicrequire()of an.mjsfile is not supported.Workaround
Use
next buildfollowed bywrangler deployseparately instead ofvinext build/vinext deploy:This bypasses vinext's Vite layer for the build step entirely.
Expected behavior
vinext buildshould work in standard CI environments (GitHub Actions, ubuntu-latest, Node 22) without requiring workarounds.