What version of Effect is running?
No response
What steps can reproduce the bug?
Run packages/sql-mssql/examples/ on Windows 10
Use bundler in tsconfig.json
"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
Change the line: https://github.com/Effect-TS/effect/blob/bec5ea459a363b7893f106643b4fb61a5246f722/packages/sql/src/Migrator/FileSystem.ts#L34C25-L34C51
Instead of ${directory}/${basename} it should be file://${directory}/${basename} for Windows OS.
This primitive solution was tested on my machine. We have to make import call OS agnostic, perhaps by adding some conditions?
What version of Effect is running?
No response
What steps can reproduce the bug?
Run
packages/sql-mssql/examples/on Windows 10Use
bundlerintsconfig.jsonWhat is the expected behavior?
Migrations should be loaded and run successfully
What do you see instead?
Additional information
Fix is needed in
packages/sql/src/Migrator/FileSystem.tsChange the line: https://github.com/Effect-TS/effect/blob/bec5ea459a363b7893f106643b4fb61a5246f722/packages/sql/src/Migrator/FileSystem.ts#L34C25-L34C51
Instead of
${directory}/${basename}it should befile://${directory}/${basename}for Windows OS.This primitive solution was tested on my machine. We have to make
importcall OS agnostic, perhaps by adding some conditions?