Could not resolve detected property at runtime
See original GitHub issueHi, I’m using this library with React-Native and I followed the instructions here. However when I try to run the project I get an error syaing: @jsonMember on AppFile.Id could not resolve detected property constructor at runtime. Are you sure, that you have both "experimentalDecorators" and "emitDecoratorMetadata" in your tscofig.json? .
This is my model for AppFile:
import 'reflect-metadata';
import { jsonObject, jsonMember, TypedJSON } from 'typedjson';
@jsonObject
export class AppFile {
@jsonMember
Id?: string;
@jsonMember
Group?: string;
@jsonMember
Name?: string;
@jsonMember
Value?: string;
@jsonMember
Active?: boolean;
@jsonMember
CacheTime?: number;
}
I added "experimentalDecorators": true and "emitDecoratorMetadata": true in tsconfig.josn.
I also added "plugins": [ ["@babel/plugin-proposal-decorators", { "legacy": true }]] in babel.config.js.
But nothing seems to work, what is the problem with my setup?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
TypedJSON: "could not resolve detected property constructor ...
I'm trying to add TypedJSON to a react.js app. My calls to serialize are failing because of error messages like
Read more >Developers - Could not resolve detected property at runtime -
Hi, I'm using this library with React-Native and I followed the instructions here. However when I try to run the project I get...
Read more >Troubleshooting .NET Framework Targeting Errors - MSBuild
This topic describes MSBuild errors that might occur because of reference issues and how you can resolve those errors.
Read more >System Properties - Essential Java Classes
System properties include information about the current user, the current version of the Java runtime, and the character used to separate components of...
Read more >AOT metadata errors - Angular
Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler. The compiler found...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I fix this issue by adding babel-plugin-transform-typescript-metadata
@jeromeheissler Thank you so much for posting this, saved my day.