You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to compile this model by using swc src -d dist command, it throws this error:
throw new errors_1.CannotDetermineTypeError((_a = target.constructor) === null || _a === void 0 ? void 0 : _a.name, propertyKey);
^
CannotDetermineTypeError: Cannot determine a type for the "User.phone" field (union/intersection/ambiguous type was used). Make sure your property is decorated with a "@Prop({ type: TYPE_HERE })" decorator.
It was not a problem to not to use type field in the @prop decorator with the tsc. It automatically determines the types with some exceptions. But swc forces me to define type. I want to use the swc for its speed of compile.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to migrate to swc compiler on NestJS. But I faced compiling typescript issues. For example, I have a model named User:
I'm trying to compile this model by using swc src -d dist command, it throws this error:
It was not a problem to not to use type field in the @prop decorator with the tsc. It automatically determines the types with some exceptions. But swc forces me to define type. I want to use the swc for its speed of compile.
Let me give my configuration files as well:
.swcrc:
tsconfig.json:
nest-cli.json:
Is there any way to use swc to compile my codes without defining the types of the Props?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions