[PR #193] [MERGED] fix: document ESM resolution behavior for validator and similar packages (#189) #377

Closed
opened 2026-05-06 12:39:30 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/193
Author: @yunus25jmi1
Created: 2/28/2026
Status: Merged
Merged: 3/8/2026
Merged by: @james-elicx

Base: mainHead: fix/issue-189-validator-esm-resolution


📝 Commits (1)

  • 75a8d4e fix: auto-detect and propagate noExternal for problematic ESM packages (#189)

📊 Changes

7 files changed (+101 additions, -0 deletions)

View changed files

📝 .agents/skills/migrate-to-vinext/references/troubleshooting.md (+16 -0)
📝 packages/vinext/src/index.ts (+2 -0)
📝 pnpm-lock.yaml (+25 -0)
📝 tests/ecosystem.test.ts (+24 -0)
tests/fixtures/ecosystem/validator/package.json (+14 -0)
tests/fixtures/ecosystem/validator/pages/index.tsx (+14 -0)
tests/fixtures/ecosystem/validator/vite.config.ts (+6 -0)

📄 Description

Summary

Documents how vinext's existing noExternal: true setting resolves ESM resolution issues for packages like validator (fixes #189).

Problem

Users importing certain ESM packages (like validator) encountered Cannot find module errors in dev server:

Cannot find module '...\validator\es\lib\util\assertString'
imported from '...\validator\es\lib\isEmail.js'

How It's Already Fixed

vinext sets noExternal: true in all server environments (RSC and SSR), which forces all dependencies through Vite's transform pipeline. This resolves extensionless import issues automatically — no user configuration needed.

Changes

  • Documentation: Added troubleshooting section explaining the existing behavior
  • Test fixture: Added tests/fixtures/ecosystem/validator/ to verify validator works out of the box
  • Ecosystem test: Added test case confirming validator SSR imports work
  • Comments: Added explanatory comments in index.ts referencing #189

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/193 **Author:** [@yunus25jmi1](https://github.com/yunus25jmi1) **Created:** 2/28/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/issue-189-validator-esm-resolution` --- ### 📝 Commits (1) - [`75a8d4e`](https://github.com/cloudflare/vinext/commit/75a8d4ec8a26c1fc77733902a546529cda3550e2) fix: auto-detect and propagate noExternal for problematic ESM packages (#189) ### 📊 Changes **7 files changed** (+101 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/migrate-to-vinext/references/troubleshooting.md` (+16 -0) 📝 `packages/vinext/src/index.ts` (+2 -0) 📝 `pnpm-lock.yaml` (+25 -0) 📝 `tests/ecosystem.test.ts` (+24 -0) ➕ `tests/fixtures/ecosystem/validator/package.json` (+14 -0) ➕ `tests/fixtures/ecosystem/validator/pages/index.tsx` (+14 -0) ➕ `tests/fixtures/ecosystem/validator/vite.config.ts` (+6 -0) </details> ### 📄 Description ## Summary Documents how vinext's existing `noExternal: true` setting resolves ESM resolution issues for packages like `validator` (fixes #189). ## Problem Users importing certain ESM packages (like `validator`) encountered `Cannot find module` errors in dev server: ``` Cannot find module '...\validator\es\lib\util\assertString' imported from '...\validator\es\lib\isEmail.js' ``` ## How It's Already Fixed vinext sets `noExternal: true` in all server environments (RSC and SSR), which forces all dependencies through Vite's transform pipeline. This resolves extensionless import issues automatically — **no user configuration needed**. ## Changes - **Documentation**: Added troubleshooting section explaining the existing behavior - **Test fixture**: Added `tests/fixtures/ecosystem/validator/` to verify validator works out of the box - **Ecosystem test**: Added test case confirming validator SSR imports work - **Comments**: Added explanatory comments in `index.ts` referencing #189 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:30 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#377
No description provided.