Michael
06/14/2021, 5:45 PM$> npx prisma generate
Everything runs fine, but all the prior references in my code to any Models I had before are broken/missing.
When I look in node_modules/.pnpm/@prisma/client@2.24.1_prisma@2.24.1/node_modules/@prisma/client/index.d.ts it's empty except for this one line:
export * from '.prisma/client'
To upgrade the dependency I ran:
$> pnpm up prisma
$> pnpm up @prisma/clientjanpio
.prisma/client as it says.Michael
06/14/2021, 6:01 PMimport { MyModelName } from '@prisma/client'
But those links are broken - how would I do this now with version 2.24.1?janpio
janpio
Michael
06/14/2021, 6:03 PMjanpio
node_modules/.prisma/client/index.d.ts probablyMichael
06/14/2021, 6:04 PM/**
* ## Prisma Client ʲˢ
*
* Type-safe database client for TypeScript & Node.js (ORM replacement)
* @example
*
* const prisma = new Prisma()
* // Fetch zero or more Users
* const users = await prisma.user.findMany()
* *
*
* Read more in our [docs](<https://github.com/prisma/prisma/blob/master/docs/prisma-client-js/api.md>).
*/
export declare const PrismaClient: any
/**
* ## Prisma Client ʲˢ
*
* Type-safe database client for TypeScript & Node.js (ORM replacement)
* @example
*
* const prisma = new Prisma()
* // Fetch zero or more Users
* const users = await prisma.user.findMany()
* *
*
* Read more in our [docs](<https://github.com/prisma/prisma/blob/master/docs/prisma-client-js/api.md>).
*/
export declare type PrismaClient = any
export declare const dmmf: any
export declare type dmmf = any
/**
* Get the type of the value, that the Promise holds.
*/
export declare type PromiseType<
T extends PromiseLike<any>
> = T extends PromiseLike<infer U> ? U : T
/**
* Get the return type of a function which returns a Promise.
*/
export declare type PromiseReturnType<
T extends (...args: any) => Promise<any>
> = PromiseType<ReturnType<T>>Michael
06/14/2021, 6:04 PMjanpio
janpio
janpio
npx prisma -v confirm the update worked?Michael
06/14/2021, 6:05 PMMichael
06/14/2021, 6:06 PM➜ api git:(MyGitBranch) ✗ npx prisma -v
Environment variables loaded from .env
prisma : 2.24.1
@prisma/client : 2.24.1
Current platform : darwin
Query Engine : query-engine 18095475d5ee64536e2f93995e48ad800737a9e4 (at ../../node_modules/.pnpm/@prisma/engines@2.24.1-2.18095475d5ee64536e2f93995e48ad800737a9e4/node_modules/@prisma/engines/query-engine-darwin)
Migration Engine : migration-engine-cli 18095475d5ee64536e2f93995e48ad800737a9e4 (at ../../node_modules/.pnpm/@prisma/engines@2.24.1-2.18095475d5ee64536e2f93995e48ad800737a9e4/node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core 18095475d5ee64536e2f93995e48ad800737a9e4 (at ../../node_modules/.pnpm/@prisma/engines@2.24.1-2.18095475d5ee64536e2f93995e48ad800737a9e4/node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt 18095475d5ee64536e2f93995e48ad800737a9e4 (at ../../node_modules/.pnpm/@prisma/engines@2.24.1-2.18095475d5ee64536e2f93995e48ad800737a9e4/node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : 18095475d5ee64536e2f93995e48ad800737a9e4
Studio : 0.397.0Michael
06/14/2021, 6:06 PMMichael
06/14/2021, 6:14 PMjanpio
npx prisma generate makes your project to go from working to not working any more?Michael
06/14/2021, 6:14 PMMichael
06/14/2021, 6:15 PMnpx prisma generateMichael
06/14/2021, 6:15 PM➜ api git:(MyGitBranch) ✗ npx prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (2.24.1) to ./node_modules/@prisma/client in 160ms
You can now start using Prisma Client in your code. Reference: <https://pris.ly/d/client>
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()```janpio
janpio
janpio
Michael
06/14/2021, 6:16 PMMichael
06/14/2021, 6:16 PMMichael
06/14/2021, 6:18 PMpnpm ) :
MyMainProj
-> apps
--> api
And I noticed the models are exported to MyMainProj->apps->api->node_modules
But my app looks in MyMainProj->apps->node_modules
Again though before with 2.19 this seemed to work fine, but for 2.24.1 it does not. I could go down the chain of minor patch releases to see when this functionality breaks for me.janpio
janpio
Michael
06/14/2021, 6:53 PMjanpio
Michael
06/14/2021, 6:54 PMnpx generate prismaMichael
06/14/2021, 6:54 PMjanpio
Michael
06/14/2021, 6:55 PM23.0 and 24.1 respectively:
➜ api git:(MyGitBranch) ✗ npx prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (2.23.0) to ./../../node_modules/.pnpm/@prisma/client@2.23.0_prisma@2.23.0/node_modules/@prisma/client in 640ms
You can now start using Prisma Client in your code. Reference: <https://pris.ly/d/client>
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
```
and:
```➜ api git:(MyGitBranch) ✗ npx prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (2.24.1) to ./node_modules/@prisma/client in 185ms
You can now start using Prisma Client in your code. Reference: <https://pris.ly/d/client>
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
``````janpio
janpio
Michael
06/14/2021, 6:56 PM../../node_modules in 24.1Michael
06/14/2021, 6:56 PMjanpio
Michael
06/14/2021, 6:56 PMjanpio
janpio