drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[BUG]: [email protected] not working with [email protected]

Open davidaragundy opened this issue 1 year ago • 19 comments

What version of drizzle-orm are you using?

0.30.10

What version of drizzle-kit are you using?

No response

Describe the Bug

react@"18.2.0" is marked as the peer dependency

image

Expected behavior

the package should be installed with no problem :)

Environment & setup

No response

davidaragundy avatar May 04 '24 01:05 davidaragundy

I'm experiencing the same issue, it happen to me yesterday trying to add drizzle to a fresh nextjs project

codePassion-dot avatar May 17 '24 23:05 codePassion-dot

I am getting the same error, is drizzle-orm not compatible with [email protected] is there any solution guys

Hrid-a avatar May 23 '24 09:05 Hrid-a

it's look like the latest version of drizzle kit(0.21.4) doesn't work with react 18.3 [email protected] is still working fine for me Just downgrade drizzle kit(0.21.4) to drizzle kit(0.21.2): npm install [email protected]

dragerra avatar May 27 '24 17:05 dragerra

im also getting this on a fresh nextjs project when installing drizzle-orm tried installing all versions of drizzle-orm down to 0.30.07 and still got the error,

Carlos-err406 avatar Jun 06 '24 15:06 Carlos-err406

I installed with legacy peer fag npm i drizzle-orm --legacy-peer-deps Or manually add in package.json then run npm install --legacy-peer-deps

Then I am able to do npm i drizzle-orm with no issue

Worked for me then I can run

joshfom avatar Jun 13 '24 08:06 joshfom

is there any statement from drizzle team?

LegendNihal avatar Jun 24 '24 07:06 LegendNihal

It's discouraging that there has been quite a few problems with Drizzle. I'm not having the same problem, and can't find a good answer yet.

jacksonsophat avatar Jul 03 '24 19:07 jacksonsophat

npm install drizzle-orm --legacy-peer-deps adding the --legacy-peer-deps will fix the problem

Hrid-a avatar Jul 03 '24 20:07 Hrid-a

npm install drizzle-orm --legacy-peer-deps adding the --legacy-peer-deps will fix the problem

This is not a "fix," this is a workaround. The drizzle team needs to update their peer dependencies. Using --legacy-peer-deps is pretty unlikely to break anything but I would probably adjust the versions of react you're using before reaching for this solution. In this case, setting the semver of react and react-dom to ~18.12.0 instead of ^18 should clear up the issue in a safer way until the drizzle team updates their peer deps to the latest version of react.

JoRyGu avatar Jul 07 '24 19:07 JoRyGu

I have the same problem. When will the developers fix it?

arthurseredaa avatar Jul 10 '24 20:07 arthurseredaa

Same problem here, fresh next.js project

kornumic avatar Jul 11 '24 10:07 kornumic

In addition to having this issue, I'm wondering why an orm depends on a front-end framework?

mbrevda avatar Jul 15 '24 12:07 mbrevda

In addition to having this issue, I'm wondering why an orm depends on a front-end framework?

i guess is for the drizzle studio? https://orm.drizzle.team/drizzle-studio/overview

Carlos-err406 avatar Jul 15 '24 14:07 Carlos-err406

In addition to having this issue, I'm wondering why an orm depends on a front-end framework?

i guess is for the drizzle studio? https://orm.drizzle.team/drizzle-studio/overview

Sounds plausible but wouldn't that be published as its own, optional, package?

mbrevda avatar Jul 15 '24 18:07 mbrevda

This problem no longer exits in [email protected]

davidaragundy avatar Jul 22 '24 01:07 davidaragundy

The issue is still there for the newly created Next.js app.

kisankumavat85 avatar Jul 22 '24 18:07 kisankumavat85

Sorry for the confusion. I was using bun and yarn and had no problem, apparently the problem persists only when using npm.

@AndriiSherman, any thoughts?

davidaragundy avatar Jul 23 '24 03:07 davidaragundy

I am absolutely new to drizzle and just prepared a fresh new nextjs project to try it out. Right after my nextjs setup, I tried to install drizzle with mysql2.

PS D:\Typescript\drizzle orm\drizzle_test> npm i drizzle-orm mysql2
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   peer react@"^18.2.0" from [email protected]
npm error   node_modules/next
npm error     next@"14.2.5" from the root project
npm error   peer react@"^18.3.1" from [email protected]
npm error   node_modules/react-dom
npm error     peer react-dom@"^18.2.0" from [email protected]
npm error     node_modules/next
npm error       next@"14.2.5" from the root project
npm error     react-dom@"^18" from the root project
npm error   2 more (styled-jsx, the root project)
npm error
npm error Could not resolve dependency:
npm error drizzle-orm@"*" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/react
npm error   peer react@"18.2.0" from [email protected]
npm error   node_modules/react-native
npm error     peer react-native@">0.73.0" from @op-engineering/[email protected]
npm error     node_modules/@op-engineering/op-sqlite
npm error       peerOptional @op-engineering/op-sqlite@">=2" from [email protected]
npm error       node_modules/drizzle-orm
npm error         drizzle-orm@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

ShayokhShorfuddin avatar Aug 14 '24 03:08 ShayokhShorfuddin

https://github.com/drizzle-team/drizzle-orm/issues/2251#issuecomment-2228400509

👍 - Why is drizzle depending on react?

theghostwhoforks avatar Sep 25 '24 20:09 theghostwhoforks

As Next.js 15 now uses "react": "19.0.0-rc-65a56d0e-20241020", this is now quite a large issue

leonlarsson avatar Oct 22 '24 19:10 leonlarsson