Migrating from v0.14 to v0.15, entities not found
Seeing these errors after following migration steps to v0.15. It seems like issues with prisma not generating my entities.
14 Replies
Hi @wardbox. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The error messages you're seeing indicate that the Prisma client is not recognizing your entities. This could be due to a few reasons:
1. Prisma client not being generated correctly: If the Prisma client is not generated correctly, it won't recognize your entities. You can try regenerating the Prisma client by running
wasp db migrate-dev
. This command will apply the latest changes to your database and also regenerate the Prisma client (source (https://github.com/wasp-lang/wasp/issues/214)).
2. Incompatible Prisma version: If you're using an incompatible version of Prisma, it could lead to issues like this. Wasp has fixed the version of Prisma to avoid such problems. Make sure you're using the correct version of Prisma (source (https://github.com/wasp-lang/wasp/issues/158)).
3. Issues with the Wasp compiler: If there are issues with the Wasp compiler, it might not be able to compile the SDK correctly, leading to these errors. You can try running wasp clean
followed by wasp start
to clean the build artifacts and start the Wasp compiler again (source (https://discord.com/channels/686873244791210014/1215750573278629958)).
If none of these solutions work, it might be helpful to check if there's a package.json
file in a directory above your Wasp project that specifies a different Prisma version. This could cause npm to use the wrong Prisma version (source (https://github.com/wasp-lang/wasp/issues/787)).
If you're still facing issues, please provide more details or consider opening an issue in the Wasp Github repository (https://github.com/wasp-lang/wasp/issues).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@kapa.ai
wasp db migrate-dev
fails with the same error. i have prisma set to "prisma": "5.19.1",
and have run wasp clean
with no successLet me check the knowledge base for you again. One moment! :books:
----------------------
The version of Prisma you're using might be causing the issue. Wasp has specific compatibility with certain versions of Prisma. For instance, it was noted in one of the issues that Prisma introduced breaking changes in version 2.13, and Wasp had to fix the version to 2.12 to avoid problems (source (https://github.com/wasp-lang/wasp/issues/158)).
Also, Wasp had issues with Node version 16.15.1 due to npm not seeing locally installed packages, which caused Wasp to use the wrong Prisma version (source (https://github.com/wasp-lang/wasp/issues/631)).
Please ensure you're using a compatible version of Node.js and Prisma with Wasp. If the problem persists, consider opening an issue in the Wasp Github repository (https://github.com/wasp-lang/wasp/issues) for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@kapa.ai this is the full error log
Let me check the knowledge base for you again. One moment! :books:
----------------------
I'm sorry, but I can't provide a helpful answer without the error log. Could you please provide the full error log? This will help me understand the issue better and provide a more accurate solution.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@wardbox ok so something went bonkers with Prisma. I had a similar issue while testing the latest 0.15 before we released it, but it happened only once and I couldn't replicate it again! So I thought it was something caused by me while developing. This might be the same thing, or not.
@sodic do you have any idea how we can approach this?
@wardbox , can you try deleting your package-lock.json, then doing
wasp clean
again, and then see if that helps?
Also, can you check if there is by accident not maybe a node_modules/ dir somewhere in the parent directories of your project? For example if your Wasp project is in /home/wardbox/projects/coolProject, maybe there is node_modules in /home/wardbox ?
Also, please share even more CLI output if you can with us, there might be sometihng else potentialy failing hm.
Btw are you using Wasp TS config (main.wasp.ts
) or are you still on main.wasp
?aha, closer after deleting package lock, now im just getting this, probably a missing env var?
also, i am not using main.wasp.ts yet, that's up next :PeepoEvil:
yep, setting mailgun api key and domain fixed that last bit 👍
Awesome! Ah damn I should ahve asked you to send us over package-lock.json first so we can get an idea what is causing this error :D.
Seems like doing migrating from 0.14 to 0.15, old package-lock.json causes this issue. It is the same one I had during our testing of RC.
@sodic any ideas?
@martinsos Ok, at least now we know what causes it. I don't think it's thanks to the TS SDK though. More likely related to the Prisma upgrade
@miho Tagging you for visibility
Makes sense since probably the old Prisma version is left behind in the
package-lock.json
- for some reason. We included this in the migration docs right?@miho I don't see package-lock.json mentioned anywhere in the migration docs.
My bad, that was the TS SDK docs: https://wasp-lang.dev/docs/general/wasp-ts-config
Wasp TypeScript config (*.wasp.ts) | Wasp
This document assumes your app works with Wasp >= 0.15.
I haven't experienced this issue with
package-lock.json
personally, so I'm not sure what causes it - I'd like to figure it out before we recommend deleting the package-lock.json
file.What we have so far @miho is me experiencing it while I was moving examples/thoughts to ts-sdk, and user here. But I am not sure how to easily replicate it. I am not sure I get though, how in theory this could be an issue. Why wouldn't lder ersion of prisma in package-lock.json be updated when we update wasp? Npm install should happen and update it right/