Closed tomagrab closed 7 months ago
I have this exact same issue when using Prisma. It seems that the generated type is not linked to the "db" object.
i have the same issue @tomagrab did you end up figuring out a solution?
upgrading prisma and @prisma/client to latest and then i also restarted the eslint server and that seemed to fix it
@iamtheozzy @opmaominc
I simply ran:
npm i
Then I was able to successfully build the project 😄
I'm not sure if something changed because this was not working beforehand. Did not need to restart the eslint server.
Provide environment information
System: OS: Windows 10 10.0.19045 CPU: (6) x64 Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz Memory: 2.73 GB / 10.00 GB Binaries: Node: 21.1.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 9.6.6 - C:\Program Files\nodejs\npm.CMD
},
Describe the bug
After scaffolding a new T3 app, I ran "npm run build" and received the following errors:
./src/app/page.tsx 54:9 Error: Unsafe assignment of an
any
value. @typescript-eslint/no-unsafe-assignment 59:68 Error: Unsafe member access .name on anany
value. @typescript-eslint/no-unsafe-member-accessThis error also happens in production when attempting to deploy to Vercel.
Reproduction repo
https://github.com/tomagrab/chirp
To reproduce
npm create t3-app@latest Need to install the following packages: create-t3-app@7.26.0 Ok to proceed? (y) │ ◇ What will your project be called? │ chirp │ ◇ Will you be using TypeScript or JavaScript? │ TypeScript │ ◇ Will you be using Tailwind CSS for styling? │ Yes │ ◇ Would you like to use tRPC? │ Yes │ ◇ What authentication provider would you like to use? │ None │ ◇ What database ORM would you like to use? │ Prisma │ ◇ EXPERIMENTAL Would you like to use Next.js App Router? │ Yes │ ◇ What database provider would you like to use? │ PostgreSQL │ ◇ Should we initialize a Git repository and stage the changes? │ Yes │ ◇ Should we run 'npm install' for you? │ Yes │ ◇ What import alias would you like to use? │ @/
Using: npm
✔ chirp scaffolded successfully!
Adding boilerplate... ✔ Successfully setup boilerplate for prisma ✔ Successfully setup boilerplate for tailwind ✔ Successfully setup boilerplate for trpc ✔ Successfully setup boilerplate for dbContainer ✔ Successfully setup boilerplate for envVariables
Installing dependencies... ✔ Successfully installed dependencies!
Initializing Git... ✔ Successfully initialized and staged git
Next steps: cd chirp ./start-database.sh npm run db:push npm run dev git commit -m "initial commit"
Thank you for trying out the App Router option. If you encounter any issues, please open an issue!
cd chirp
npm run build
▲ Next.js 14.1.0
Environments: .env
Creating an optimized production build ... (node:16796) [DEP0040] DeprecationWarning: The
punycode
module is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...
to show where the warning was created) (node:27316) [DEP0040] DeprecationWarning: Thepunycode
module is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...
to show where the warning was created) ✓ Compiled successfullyFailed to compile.
./src/app/page.tsx 54:9 Error: Unsafe assignment of an
any
value. @typescript-eslint/no-unsafe-assignment 59:68 Error: Unsafe member access .name on anany
value. @typescript-eslint/no-unsafe-member-accessinfo - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules Linting and checking validity of types
Additional information
No response