Open anikghosh256 opened 1 week ago
This will be tricky to debug because I don't have a windows machine. I suspect it's something to do with fast-glob not finding files. Try finding the compiled version of this line in your node_modules and adding some logging around it:
const paths = await glob(globString, {...globOptions, ignore, absolute: true})
If that's returning an empty array, there's your problem. You can then play around with the glob options to see what needs changing.
Thanks for the suggestion, @mmkal. Indeed, it returns an empty array on Windows. The issue seems to stem from how path.dirname(import.meta.url.replace("file://", ""))
behaves on Windows, yielding a path like /D:/dev/
. When I manually specify the cwd
option, I encounter the following error:
failed: Original 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:'
This leads me to believe that the package might need to incorporate OS-specific handling to address this discrepancy.
Environment
Description
I'm encountering an issue on Windows where running migrations with Umzug results in the message "applied 0 migrations." without actually applying any migrations. The same setup works as expected on macOS and Ubuntu.
Steps to Reproduce
Expected Behavior
Migrations should be applied, and the database should be updated accordingly.
Actual Behavior
The output is
{ event: 'up', message: 'applied 0 migrations.' }
and no migrations are applied to the database.Code Snippet
Additional Context
My
package.json
has"type": "module"
. This issue occurs only on Windows; the migrations work as expected on macOS and Ubuntu.