[BUG]: `SyntaxError: Cannot use import statement outside a module` with drizzle-kit
Problem
What version of `drizzle-orm` are you using? ^0.27.0 What version of `drizzle-kit` are you using? ^0.19.2 Describe the Bug I have the following syntax error when trying to use drizzle-kit: [code block] Expected behavior _No response_ Environment & setup - pnpm - monorepo - Mac OS [code block] [code block]
Error Output
error when trying to use drizzle-kit:
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [BUG]: `SyntaxError: Cannot use import statement outside a module` with drizzle-kit
@aditya-kumarr What you could do (and what I've done) in the meantime is this: 1. Add an `outdir` to your tsconfig: [code block] 2. Modify your `package.json` scripts to run a build prior to running any drizzle-kit commands: [code block] 3. Modify your drizzle config to point to your new dist folder instead: [code block] You may need to modify these steps slightly depending on your project sett
Trust Score
5 verifications
- 1
@aditya-kumarr What you could do (and what I've done) in the meantime is this:
@aditya-kumarr What you could do (and what I've done) in the meantime is this:
- 2
Add an `outdir` to your tsconfig:
[code block] 2. Modify your `package.json` scripts to run a build prior to running any drizzle-kit commands: [code block] 3. Modify your drizzle config to point to your new dist folder instead: [code block]
- 3
You may need to modify these steps slightly depending on your project settings/r
You may need to modify these steps slightly depending on your project settings/requirements, but this should give you a general idea.
- 4
Edit: Essentially I did what this person did: https://github.com/drizzle-team/dr
Edit: Essentially I did what this person did: https://github.com/drizzle-team/drizzle-orm/issues/1561#issuecomment-2211815525
Validation
Resolved in drizzle-team/drizzle-orm GitHub issue #819. Community reactions: 9 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep