Skip to content
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

Breaks with 5.9.1 release of Prisma #97

Closed
kimchinosys opened this issue Feb 6, 2024 · 5 comments · Fixed by #98
Closed

Breaks with 5.9.1 release of Prisma #97

kimchinosys opened this issue Feb 6, 2024 · 5 comments · Fixed by #98

Comments

@kimchinosys
Copy link

Here is the error that gets thrown

Type 'BaseDMMF' is not assignable to type '{ datamodel: { models: { name: string; fields: { name: string; isList: boolean; isUnique: boolean; isId: boolean; type?: any; documentation?: string | undefined; }[]; }[]; }; }'.
  The types of 'datamodel.models' are incompatible between these types.
    The type 'readonly ReadonlyDeep_2<ReadonlyDeep_2<ReadonlyDeep_2<{ name: string; dbName: string | null; fields: ReadonlyDeep_2<{ kind: FieldKind; name: string; isRequired: boolean; isList: boolean; isUnique: boolean; isId: boolean; isReadOnly: boolean; ... 10 more ...; documentation?: string | undefined; }>[]; ... 4 more ...; ...' is 'readonly' and cannot be assigned to the mutable type '{ name: string; fields: { name: string; isList: boolean; isUnique: boolean; isId: boolean; type?: any; documentation?: string | undefined; }[]; }[]'.

It is related to this step in the setup: https://www.npmjs.com/package/prisma-field-encryption#custom-prisma-client-location

@franky47
Copy link
Member

franky47 commented Feb 6, 2024

From the error it looks like they made the exported DMMF type readonly, which is fair enough. However doing so recursively with a non-native type helper may make it difficult to properly type on our end.

Does it work at runtime if you // @ts-expect-error the dmmf assignment line?

franky47 added a commit that referenced this issue Feb 6, 2024
franky47 added a commit that referenced this issue Feb 6, 2024
* chore: Update dependencies

* chore: Add types for `debug` dependency

* fix: Mark DMMF as deep readonly

Closes #97.

* chore: Bump node version to LTS
Copy link

github-actions bot commented Feb 6, 2024

🎉 This issue has been resolved in version 1.5.2-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@franky47
Copy link
Member

franky47 commented Feb 6, 2024

@kimchinosys thanks to Zod it was an easy fix, could you try the 1.5.2-beta.1 release and let me know if it works OK for you? Then I'll publish to latest.

@kimchinosys
Copy link
Author

Amazing, it works, thank you for the quick fix.

Copy link

github-actions bot commented Feb 7, 2024

🎉 This issue has been resolved in version 1.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants