-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typegen error: has no exported member 'QueryMode' or 'SortOrder' #1056
Comments
I ran into the same issue after upgrading from Possible underlying issue? (not sure)The underlying issue seems to be that in the latest version of Prisma, 2.17 -
|
This workaround is what was recommended to me too by maintainers of Prisma. Also, I would like to point out, that the error is type-check error only and the code will still output working code, as such it can be safely ignored as long as builds outputs files. |
This file is generated by the system. How would you permanently change it? |
@0xsven You don't... You have to edit it after every generation... We can only hope this will get fixed... |
Another workaround is to set |
@jasonkuhrt Would you mind looking into this? It is currently breaking every server build (I had to create bash utility to replace I know that you (as prisma) are working on a new plugin, but this will help in the meantime. it should be a simple fix :) |
@ltnscp9028 doesnt work for me |
This package is basically archivated for now, use this workaround:
Rename the file to your file and if multiple replacements must be made, copy the command twice... not great, but it will do the job for now. |
This worked fine. Thank you!
|
@Akxe @0xsven nice hack with replace-in-file, but it doesn't trigger when nexus is generated by the dev server on model/api change. To use nexus-plugin-prisma with prisma above 2.14, we can override "compilerOptions": {
"paths": {
".prisma/client": ["utils/fix-prisma-client-for-nexus.ts"]
}
} /* eslint-disable import/no-relative-packages */
import { Prisma } from '../../node_modules/.prisma/client';
export * from '../../node_modules/.prisma/client';
// Fix nexus-plugin-prisma using QueryMode/SortOrder moved in prisma 2.15
// See https://github.com/graphql-nexus/nexus-plugin-prisma/issues/1056
export type SortOrder = Prisma.SortOrder;
export type QueryMode = Prisma.QueryMode;
export const { SortOrder, QueryMode } = Prisma; |
I replaced the types in export const schema = makeSchema({
// ... rest of makeSchema config
mapping: {
//...all custom scalars
SortOrder: 'prisma.Prisma.SortOrder',
QueryMode: 'prisma.Prisma.QueryMode',
},
}, |
Amazing fix @chrishoermann thank you! |
Since I have upgraded my dependencies to...
... I am getting the following error when transpiling my app:
My workaround is to downgrade prisma client like so:
Somehow prisma client 2.15.0 introduced a change that breaks my build. Any ideas what I am missing?
The text was updated successfully, but these errors were encountered: