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

"@prisma/client": "^5.19.1" got inserted to "dependencies" in package.json file, causing trouble #2330

Open
Martinsos opened this issue Oct 8, 2024 · 7 comments
Labels
bug Something isn't working prisma

Comments

@Martinsos
Copy link
Member

Martinsos commented Oct 8, 2024

This happened to me while testing out waspc/examples/todoApp with new TS SDK.

Maybe it was caused by wasp ts-setup that comes just for purpose of TS SDK?

Or maybe it was caused by recent updates we did to Prisma and now Prisma is doing this as a new beahviour?

Anyway, we need to make sure this doesn't happen, as it caused trouble due to @prisma/client ending up going to 5.20 due to ^ and then we have a missmatch between 5.20 client and 5.19 the rest of prisma (because we don't have ^ for our prisma dep in devDependencies) (you get warning in the CLI).

We might also want to add package.json validation for this -> that will make sure, if they do add @prisma/client to dependencies, that it has exactly the version we expect it to have. Or, they are not even allowed to add it? We have to figure out exactly he condition, but we should validate it.

@Martinsos Martinsos added bug Something isn't working prisma labels Oct 8, 2024
@amirseyedian
Copy link

I was able to temporarily fix the issue by downgrading to 0.14.2 from 0.15.1.

@infomiho
Copy link
Contributor

@amirseyedian Do you know which steps led to you having the problem? Ideally, we'd fix this in 0.15.1 rather then requiring a downgrade.

@amirseyedian
Copy link

Sure I transported my project to a new device, installed wasp with the script (which installed the latest version) ran wasp clean and npm i then wasp start.

Wasp requires package "prisma" to be version "5.19.1" in package.json.

I was also able to reproduce the error by creating new projects using templates
wasp new test -t saas and wasp start resulted in the same error.
I tried to mess around with the prisma dependency version but that didn't make any difference.

@Martinsos
Copy link
Member Author

@amirseyedian I just tried the following on my machine:

cd ~/test/
wasp new TestSaas -t saas
cd TestSaas/app
wasp start

Then I checked package.json, but I don't see @prisma/client being inserted under its dependencies, meaning I failed to replicate it.

But for you, these exact steps brought you to this error? Did I miss some step?

Also, can you tell us a bit more about your system maybe? Operating system? Node / npm version?

@amirseyedian
Copy link

I upgraded to 0.15.1 again just to dublecheck and you are correct the error no longer occurs while creating new projects from template however the error still persists regarding my previous project.

@jeremysltn
Copy link

I had this error after I tried to migrate my 0.14.x project by just changing the wasp version in main.wasp and reinstalling wasp.

Fixed it by following the Migration from 0.14.0 to 0.15.0 doc. However, prisma should be in devDependencies and not in dependencies.

@infomiho
Copy link
Contributor

infomiho commented Oct 23, 2024

@jeremysltn You are quite right! The migration docs are wrong and the prisma deps should be in the devDependencies.

Fixed now here: #2355

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

No branches or pull requests

4 participants