Windows: EmDash 0.37.0 fails during module load with invalid file:/// createRequire URL
Summary
On Windows, EmDash 0.37.0 cannot be imported by an Astro project. Module evaluation throws before Astro loads its config because the bundled registry verifier calls createRequire("file:///emdash-registry-verification.js"). Node rejects this root file URL on Windows.
Environment
- OS: Windows 11 (PowerShell)
- Node.js: v24.11.1 (also reproduced with v22.16.0, the documented minimum)
- EmDash: 0.37.0
- Astro: 7.3.2
- Vite: 8.3.0
- Package manager: pnpm 11.9.0
Reproduction
- Create an Astro project and install
emdash@0.37.0 (and @emdash-cms/plugin-forms@0.2.6, which imports the API bundle).
- Run:
node -e "import('emdash').then(()=>console.log('ok')).catch(e=>console.error(e.stack))"
Actual result
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 'file:///emdash-registry-verification.js'
at createRequire (node:internal/modules/cjs/loader:1963:13)
at .../node_modules/emdash/dist/api-Dz6rgoa3.mjs:3789:33
The same error occurs under Node v22.16.0. It prevents astro build, astro check, and any test importing emdash.
Expected result
The package should import successfully on Windows under the supported Node versions.
Suspected cause
The bundled output uses a POSIX-root file URL string (file:///emdash-registry-verification.js) as the anchor for createRequire. On Windows, Node requires a Windows absolute path or a file URL with a drive letter.
Impact
All Windows Astro projects using EmDash 0.37.0 are blocked before application code executes.
Windows: EmDash 0.37.0 fails during module load with invalid
file:///createRequireURLSummary
On Windows, EmDash 0.37.0 cannot be imported by an Astro project. Module evaluation throws before Astro loads its config because the bundled registry verifier calls
createRequire("file:///emdash-registry-verification.js"). Node rejects this root file URL on Windows.Environment
Reproduction
emdash@0.37.0(and@emdash-cms/plugin-forms@0.2.6, which imports the API bundle).Actual result
The same error occurs under Node v22.16.0. It prevents
astro build,astro check, and any test importingemdash.Expected result
The package should import successfully on Windows under the supported Node versions.
Suspected cause
The bundled output uses a POSIX-root file URL string (
file:///emdash-registry-verification.js) as the anchor forcreateRequire. On Windows, Node requires a Windows absolute path or a file URL with a drive letter.Impact
All Windows Astro projects using EmDash 0.37.0 are blocked before application code executes.