mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #521] Missing .js alias variants for next/config and next/amp #110
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#110
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 @NathanDrake2406 on GitHub (Mar 13, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/521
Problem
The shim alias map in the Vite plugin registers
next/configandnext/ampbut not their.jsextension variants (next/config.js,next/amp.js).Every other public
next/*entrypoint has both variants (e.g.,next/navigation+next/navigation.js). These.jsvariants are required because some libraries — likenuqs— import Next.js modules with the explicit.jsextension. Without the alias, Vite resolves to the realnextpackage instead of vinext's shim, causing build failures or runtime errors.Expected behavior
import "next/config.js"andimport "next/amp.js"should resolve to the vinext shims, just likeimport "next/config"andimport "next/amp"do.Fix
Add the two missing
.jsalias entries to the shim map inindex.ts.