You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrator.fromFileSystem fails on Windows under moduleResolution:bundler option in tsconfig.json #4297
"compilerOptions": {
// ts version and module resolution (use the lasted ts/js features and types)
"lib": ["ESNext", "dom", "dom.iterable"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"moduleResolution": "bundler",
What is the expected behavior?
Migrations should be loaded and run successfully
What do you see instead?
ERROR (#0):
MigrationError: Could not import migration "1_mvp"
Error: Only URLs with a scheme in: file,data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
at _ (D:\Projects\CA Price\node_modules\@effect\sql\src\Migrator.ts:151:11)
at cause (D:\Projects\CA Price\node_modules\effect\src\internal\core-effect.ts:165:18)
at sql.transaction
Additional information
Fix is needed in packages/sql/src/Migrator/FileSystem.ts
The specifier of an import statement is the string after the from keyword, e.g. 'path' in import { sep } from 'path'. Specifiers are also used in export from statements, and as the argument to an import() expression.
There are four types of specifiers:
Bare specifiers like 'some-package'. They refer to an entry point of a package by the package name.
Deep import specifiers like 'some-package/lib/shuffle.mjs'. They refer to a path within a package prefixed by the package name.
Relative specifiers like './startup.js' or '../config.mjs'. They refer to a path relative to the location of the importing file.
Absolute specifiers like 'file:///opt/nodejs/config.js'. They refer directly and explicitly to a full path.
I ran into this issue today on Win11 w/ node 22 trying to get the HTTP server example working form the "Getting Started" page. The quick-and-dirty fix to pathToFileURL(${directory}/${basename}).href in FileSystem.ts got me to a point where the HTTP server starts.
Activity
sukazavr commentedon Jan 20, 2025
nodejs/node#31710 (comment)
As per node.js documentation:
The specifier of an import statement is the string after the from keyword, e.g. 'path' in import { sep } from 'path'. Specifiers are also used in export from statements, and as the argument to an import() expression.
There are four types of specifiers:
fix(typesync): make dynamic import work on Windows
fix(typesync): make dynamic import work on Windows
mk2s commentedon Sep 11, 2025
I ran into this issue today on Win11 w/ node 22 trying to get the HTTP server example working form the "Getting Started" page. The quick-and-dirty fix to pathToFileURL(
${directory}/${basename}).href in FileSystem.ts got me to a point where the HTTP server starts.abdeltif-b commentedon Oct 2, 2025
Any update on this? I have the same issue on Windows 11