-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrations not applying on Windows - "applied 0 migrations" message #676
Comments
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:
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 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. |
I have this exact same issue with umzug. I found some insights from stackoverflow: Quoting the site: So if i'm correct, the right url should be: example: import { pathToFileURL } from 'url';
const file = pathToFileURL(process.cwd()).href; |
I'm also seeing this issue, even when I hardcode the path i.e. I've narrowed it down to fastglob not returning anything in the |
I'm still not totally clear on what the problem is, but I am sure that fast-glob can support windows, given the right inputs. A PR would to fix by someone using windows would be welcome. |
I have tried to set it up on Windows to identify the issue, but encountered some challenges. The setup includes I'm working on a PR to address the current issue mentioned in this GitHub issue. |
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.
The text was updated successfully, but these errors were encountered: