Skip to content
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]: TypeError: Cannot read properties of undefined (reading 'primaryKey') #2324

Closed
aliy321 opened this issue May 15, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@aliy321
Copy link

aliy321 commented May 15, 2024

What version of drizzle-orm are you using?

^0.30.10

What version of drizzle-kit are you using?

^0.21.2

Describe the Bug

There's an issue when i try to run npx drizzle-kit push, keep getting

TypeError: Cannot read properties of undefined (reading 'primaryKey')
    at logSuggestionsAndReturn2

base on this discord post: https://discord.com/channels/1043890932593987624/1151920448049782915/1240052746770710578

Was able to temporarily fix it by monkey patching the bin.cjs file referenced in the error, simply by adding optional chaining like so
Image
You guys should probably consider adding  "noUncheckedIndexedAccess": true, to Drizzle-kit tsconfig.json, 
otherwise these kinds of errors will always keep popping up

Expected behavior

dotenv drizzle-kit push

drizzle-kit: v0.21.2
drizzle-orm: v0.30.10

Warning You are about to execute current statements:

ALTER TABLE posts DROP COLUMN image;

[✓] Changes applied

Environment & setup

No response

@aliy321 aliy321 added the bug Something isn't working label May 15, 2024
@AndriiSherman
Copy link
Member

This should be fixed in drizzle-kit@0.21.3. If the issue persists, feel free to reopen it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants