-
-
Notifications
You must be signed in to change notification settings - Fork 739
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
[BUG]: Cannot find module error when import includes '.js' file extension in TypeScript project #2705
Comments
I also encountered this issue. Since it is recommended to use Is there any workaround? |
I'm also experiencing this issue (drizzle-orm 0.33.0; drizzle-kit 0.24.0) - I ran into it while running the So far I've thought of two different workarounds:
Personally, I've gone with the second workaround for now. Hopefully this helps if you're experiencing the same issue. |
I also encountered this issue. Any Idea when a potential fix will be shipped? |
Same issue. Very surprised this isn't fixed yet. |
Same here |
Another workaround is to use different module settings in your tsconfig file.
Then you should be able to take the file extension types off all your imports (or at least the relevant ones in your schema files for drizzle). I don't think this has any negative side effects (besides needing to import cjs modules with a different syntax), but I'm no TS wizard. You'll have to ask Matt Pocock 😄 |
What version of
drizzle-orm
are you using?0.32.1
What version of
drizzle-kit
are you using?0.23.0
Describe the Bug
Attempting to generate a migration script fails with 'cannot find module' when a module path includes the '.js' file extension in TypeScript project. Similar issue, if not the same, #849
Sample project to recreate the issue
https://github.com/Skulltulla/drizzle-kit-mirror-fork/tree/issues/drizzle-issues-0000
Expected behavior
Generating a migration completes successfully when the module import path includes a '.js' file extension.
Environment & setup
The text was updated successfully, but these errors were encountered: