Autocomplete none
hey guys i have created a project using prisma
installed
but i cant get the auto complete ++ the tyope of prisma is any?
1 Reply
You chose to compile with the bot. One moment while I piece together your answer…
It sounds like you're experiencing two common issues: lack of autocomplete and the
prisma
variable being typed as any
. Here are the most likely causes and solutions based on the knowledge sources:
1. TypeScript Version in VSCode: If VSCode is using a different TypeScript version than your project, autocomplete and type inference may not work. Make sure VSCode is using your workspace TypeScript version (click the TypeScript version number in the VSCode status bar and select the workspace version) source.
2. Prisma Client Not Generated or Outdated: Ensure you have run npx prisma generate
after any schema changes. If the generated client is missing or outdated, types won't be available source.
3. Incorrect Import Path: If you have customized the Prisma Client output path in your schema.prisma
, you must import from that path, not from @prisma/client
. For example, if your generator is:
Then import like:
source.
4. VSCode/TS Server Cache: Sometimes, restarting VSCode or the TypeScript server is necessary after generating the client or changing config source.
5. Global Variable Typing: Your code for global Prisma instance is fine, but if you see any
, it usually means TypeScript can't find the types. This is often due to one of the issues above.
Summary of steps to fix:
- Run npx prisma generate
.
- Ensure your import path matches your generator output.
- Make sure VSCode uses your workspace TypeScript version.
- Restart VSCode after changes.
If you still see any
, double-check your import path and that the generated client exists. If
your output is default, import { PrismaClient } from "@prisma/client"
should work. If not, use the custom path as shown above.
If these steps don't resolve the issue, please provide your schema.prisma
generator block and confirm your project structure.
✅ Great, thanks for letting us know that this solved your question!