-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
[BUG] Optional forgein key cause ReferenceError in ESM mode #2863
Comments
Hi @vangie See you |
@vangie It seems to be solved by that: if (isRequired && !isList && !isNullable && hasCircularRef && ["inputObjectTypes", "enumTypes"].includes(location)) {
hasCircularRef && !isList && field.model.addImportDeclaration("@tsed/core", "Relation", true);
TSType = `Relation<${TSType}>`;
} But in this case, the code isn't generated as expected. You should have a Relation in the generated code. See:
Maybe the condition isn't correct in your case. |
PR #2864 |
1 similar comment
🎉 This issue has been resolved in version 7.83.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
@Romakita My problem is resolved, Thanks! |
🎉 This issue has been resolved in version 8.0.0-beta.10 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 8.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Describe the bug
my project is run in ESM, I using Prisma create a optional forgein key relation between two Model,after
npx prisma migrate
, then throw following error on start up project.To Reproduce
cause following error
I found that if remove the '?' after String and Assignment as following, it will not cause the error.
Expected behavior
file:///Users/duwan/Workspaces/babelcloud/babel-agent/node_modules/.pnpm/@tSed+prisma@7.83.3_@prisma[email protected]_prisma@5.20.0__@tsed+core@7.83.3_@tsed+di@7.83.3_@t_vf7jy3uhtsnnr6bz5e5qbyw76e/node_modules/@tsed/prisma/lib/.schema/models/ConversationModel.js
if i change the secord AssignmentModel to Object manually, everything is well。
Code snippets
No response
Repository URL example
No response
OS
macOS
Node version
v20.11.1
Library version
v7.83.3
Additional context
ESM mode
The text was updated successfully, but these errors were encountered: