-
Notifications
You must be signed in to change notification settings - Fork 11
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
Check tsconfig and add .ts to imports #18
Comments
Ah, this won't work drizzle-team/drizzle-orm#849 I ran the generator yesterday evening and didn't try to migrate until this morning and noticed it can't find the tables. |
This is the way:
A bit off-topic but, is the following supposed to work? export default defineConfig({
schema: './drizzle/schema/schema.ts',
}) It can't find any tables from the export default defineConfig({
schema: './drizzle/schema/*',
}) |
@hilja do you mind making a repository where I can reproduce the issue? So far I'm importing the generated models in a next.js project (using the tsconfig created from |
Here's a quick repro: The app I was testing with is loosely based on the epic stack https://github.com/epicweb-dev/epic-stack So I hacked up prisma-generator-drizzle in there https://github.com/hilja/drizzle-test. Note that the app won't actually work because I used postgres (epic-stack is sqlite). But the generator should. Setup: git clone [email protected]:hilja/drizzle-test.git
cd drizzle-test
npm i
npm prisma generate After generating the drizzle schema, the imports in And when trying to
|
I have the same issue. To make things easy I believe this library could just always add the |
I just opened a PR to add the js extension. @hilja as a temporary workaround you can use my fork by installing it from a git URL.
|
@daniel-nagy @hilja I just patched the import logic to determine based on the project's moduleResolution, let me know if it's not working |
It breaks on my repo 😅 I couldn't find any better approach, so I just provide the config to override |
Not a big problem, but if you’ve got something like this in tsonfig you need to import with
.ts
extension. Could also be a setting.The text was updated successfully, but these errors were encountered: