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
The example says that I should define __dirname as const __dirname = new URL(".", import.meta.url).pathname.replace(/\/$/, ""). This puts a / at the start of the path, which breaks glob. I can remove it (i.e. const __dirname = new URL(".", import.meta.url).pathname.replace(/\/$/, "").replace(/^\//, "");) which allows glob to find the migration files, but then the subsequent dynamic import fails with this error,
Error: Migration 2023.08.16T14.29.36.init.ts (up) 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:'.
I can work around the issue by overriding the resolver and doing the dynamic import like this, I simplified it also for our case,
I'm getting this error after switching to my package to a node module and Typescript module resolution to NodeNext,
My tsconfig module settings are as follows amongst other things, and uses project references but I don't think that's the issue,
I don't have the script that's running in the same directory as the migration directory, so I have to do something like this for glob to work.
or
The example says that I should define
__dirname
asconst __dirname = new URL(".", import.meta.url).pathname.replace(/\/$/, "")
. This puts a/
at the start of the path, which breaksglob
. I can remove it (i.e.const __dirname = new URL(".", import.meta.url).pathname.replace(/\/$/, "").replace(/^\//, "");
) which allows glob to find the migration files, but then the subsequent dynamic import fails with this error,I can work around the issue by overriding the resolver and doing the dynamic import like this, I simplified it also for our case,
The text was updated successfully, but these errors were encountered: