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.
[ Wasp ] entities/index.ts(11,8): error TS2305: Module '"@prisma/client"' has no exported member 'TeamPlayer'.
[ Wasp ] entities/index.ts(12,8): error TS2305: Module '"@prisma/client"' has no exported member 'Summoner'.
[ Wasp ] entities/index.ts(13,8): error TS2305: Module '"@prisma/client"' has no exported member 'Rank'.
[ Wasp ] entities/index.ts(14,8): error TS2305: Module '"@prisma/client"' has no exported member 'File'.
[ Wasp ] entities/index.ts(15,8): error TS2305: Module '"@prisma/client"' has no exported member 'Event'.
[ Wasp ] entities/index.ts(16,8): error TS2305: Module '"@prisma/client"' has no exported member 'Match'.
[ Wasp ] entities/index.ts(17,8): error TS2305: Module '"@prisma/client"' has no exported member 'MatchTeam'.
[ Wasp ] entities/index.ts(18,8): error TS2305: Module '"@prisma/client"' has no exported member 'Ban'.
[ Wasp ] entities/index.ts(19,8): error TS2305: Module '"@prisma/client"' has no exported member 'Participant'.
[ Wasp ] entities/index.ts(11,8): error TS2305: Module '"@prisma/client"' has no exported member 'TeamPlayer'.
[ Wasp ] entities/index.ts(12,8): error TS2305: Module '"@prisma/client"' has no exported member 'Summoner'.
[ Wasp ] entities/index.ts(13,8): error TS2305: Module '"@prisma/client"' has no exported member 'Rank'.
[ Wasp ] entities/index.ts(14,8): error TS2305: Module '"@prisma/client"' has no exported member 'File'.
[ Wasp ] entities/index.ts(15,8): error TS2305: Module '"@prisma/client"' has no exported member 'Event'.
[ Wasp ] entities/index.ts(16,8): error TS2305: Module '"@prisma/client"' has no exported member 'Match'.
[ Wasp ] entities/index.ts(17,8): error TS2305: Module '"@prisma/client"' has no exported member 'MatchTeam'.
[ Wasp ] entities/index.ts(18,8): error TS2305: Module '"@prisma/client"' has no exported member 'Ban'.
[ Wasp ] entities/index.ts(19,8): error TS2305: Module '"@prisma/client"' has no exported member 'Participant'.
14 Replies
kapa.ai
kapa.ai2mo ago
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?
wardbox
wardboxOP2mo ago
@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 success
kapa.ai
kapa.ai2mo ago
Let 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?
wardbox
wardboxOP2mo ago
@kapa.ai this is the full error log
kapa.ai
kapa.ai2mo ago
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?
martinsos
martinsos2mo ago
@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?
wardbox
wardboxOP2mo ago
aha, closer after deleting package lock, now im just getting this, probably a missing env var?
[ Client!] Debugger attached.
[ Server!] Debugger attached.
[ Client ] > [email protected] start
[ Client ] > npm run validate-env && vite
[ Client ]
[ Server ] > [email protected] watch
[ Server ] > nodemon --exec 'npm run bundle-and-start || exit 1'
[ Server ]
[ Client!] Debugger attached.
[ Client ]
[ Client ] > [email protected] validate-env
[ Client ] > node -r dotenv/config ./scripts/validate-env.mjs
[ Client ]
[ Server!] Debugger attached.
[ Server ] [nodemon] 2.0.22
[ Server ] [nodemon] to restart at any time, enter `rs`
[ Server ] [nodemon] watching path(s): src/**/* ../../../src/**/* .env
[ Server ] [nodemon] watching extensions: ts,mts,js,mjs,json
[ Server ] [nodemon] starting `npm run bundle-and-start || exit 1`
[ Client!] Debugger attached.
[ Client ] 🔍 Validating environment variables...
[ Client!] Waiting for the debugger to disconnect...
[ Client!] Waiting for the debugger to disconnect...
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] bundle-and-start
[ Server ] > npm run bundle && npm run start
[ Server ]
[ Client!] Debugger attached.
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] bundle
[ Server ] > rollup --config --silent
[ Server ]
[ Server!] Debugger attached.
[ Client ]
[ Client ] VITE v5.4.9 ready in 609 ms
[ Client ]
[ Client ] ➜ Local: http://localhost:3000/
[ Client ] ➜ Network: http://192.168.1.16:3000/
[ Client ] ➜ press h + enter to show help
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] start
[ Server ] > npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js
[ Server ]
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] validate-env
[ Server ] > node -r dotenv/config ./scripts/validate-env.mjs
[ Server ]
[ Server!] Debugger attached.
[ Server ] 🔍 Validating environment variables...
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Debugger attached.
[ Server!] Waiting for the debugger to disconnect...
[ Server!] webpack://mailgun/lib/Classes/MailgunClient.ts:67
[ Server!] throw new Error('Parameter "key" is required');
[ Server!] ^
[ Server!]
[ Server!]
[ Server!] Error: Parameter "key" is required
[ Server!] at e (webpack://mailgun/lib/Classes/MailgunClient.ts:67:13)
[ Server!] at e.e.client (webpack://mailgun/lib/index.ts:18:12)
[ Server!] at initMailgunEmailSender (/Users/dylank/personal_git/wardstone/app/.wasp/out/sdk/wasp/server/email/core/providers/mailgun.ts:13:26)
[ Server!] at <anonymous> (/Users/dylank/personal_git/wardstone/app/.wasp/out/sdk/wasp/server/email/index.ts:12:41)
[ Server!] at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
[ Server!] at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
[ Server!] at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
[ Server!]
[ Server!] Node.js v20.15.1
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Waiting for the debugger to disconnect...
[ Server ] [nodemon] app crashed - waiting for file changes before starting...
[ Client!] Debugger attached.
[ Server!] Debugger attached.
[ Client ] > [email protected] start
[ Client ] > npm run validate-env && vite
[ Client ]
[ Server ] > [email protected] watch
[ Server ] > nodemon --exec 'npm run bundle-and-start || exit 1'
[ Server ]
[ Client!] Debugger attached.
[ Client ]
[ Client ] > [email protected] validate-env
[ Client ] > node -r dotenv/config ./scripts/validate-env.mjs
[ Client ]
[ Server!] Debugger attached.
[ Server ] [nodemon] 2.0.22
[ Server ] [nodemon] to restart at any time, enter `rs`
[ Server ] [nodemon] watching path(s): src/**/* ../../../src/**/* .env
[ Server ] [nodemon] watching extensions: ts,mts,js,mjs,json
[ Server ] [nodemon] starting `npm run bundle-and-start || exit 1`
[ Client!] Debugger attached.
[ Client ] 🔍 Validating environment variables...
[ Client!] Waiting for the debugger to disconnect...
[ Client!] Waiting for the debugger to disconnect...
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] bundle-and-start
[ Server ] > npm run bundle && npm run start
[ Server ]
[ Client!] Debugger attached.
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] bundle
[ Server ] > rollup --config --silent
[ Server ]
[ Server!] Debugger attached.
[ Client ]
[ Client ] VITE v5.4.9 ready in 609 ms
[ Client ]
[ Client ] ➜ Local: http://localhost:3000/
[ Client ] ➜ Network: http://192.168.1.16:3000/
[ Client ] ➜ press h + enter to show help
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] start
[ Server ] > npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js
[ Server ]
[ Server!] Debugger attached.
[ Server ]
[ Server ] > [email protected] validate-env
[ Server ] > node -r dotenv/config ./scripts/validate-env.mjs
[ Server ]
[ Server!] Debugger attached.
[ Server ] 🔍 Validating environment variables...
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Debugger attached.
[ Server!] Waiting for the debugger to disconnect...
[ Server!] webpack://mailgun/lib/Classes/MailgunClient.ts:67
[ Server!] throw new Error('Parameter "key" is required');
[ Server!] ^
[ Server!]
[ Server!]
[ Server!] Error: Parameter "key" is required
[ Server!] at e (webpack://mailgun/lib/Classes/MailgunClient.ts:67:13)
[ Server!] at e.e.client (webpack://mailgun/lib/index.ts:18:12)
[ Server!] at initMailgunEmailSender (/Users/dylank/personal_git/wardstone/app/.wasp/out/sdk/wasp/server/email/core/providers/mailgun.ts:13:26)
[ Server!] at <anonymous> (/Users/dylank/personal_git/wardstone/app/.wasp/out/sdk/wasp/server/email/index.ts:12:41)
[ Server!] at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
[ Server!] at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
[ Server!] at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
[ Server!]
[ Server!] Node.js v20.15.1
[ Server!] Waiting for the debugger to disconnect...
[ Server!] Waiting for the debugger to disconnect...
[ Server ] [nodemon] app crashed - waiting for file changes before starting...
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 👍
martinsos
martinsos2mo ago
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?
Filip
Filip2mo ago
@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
miho
miho4w ago
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?
martinsos
martinsos4w ago
@miho I don't see package-lock.json mentioned anywhere in the migration docs.
miho
miho4w ago
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.
miho
miho4w ago
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.
martinsos
martinsos4w ago
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/
Want results from more Discord servers?
Add your server