Closed omarbelkhodja closed 4 years ago
Hi, could you tell me what kind of project you are building: React, Angular, NodeJS, another one?
I'm building pwa-webpack-starter-kit.
Ok.
Did you add "emitDecoratorMetadata": true
and "experimentalDecorators": true
inside your tsconfig.json
file?
Yes, they are already there. I think there is a specific issue related to babel/webpack compiling of TS.
I know that babel does not support emitDecoratorMetadata
, but webpack should work, let me inspect.
Did you succeed to reproduce the problem ?
I'm currently working on another project for the moment, I'll give you some feedbacks when I have information.
My current debug results: the problem happens because only target is defined
function JsonProperty(args) {
return function (target, key, index)
decorators[i]
is a reference to JsonProperty
decorateElement: function decorateElement(element, placements) {
var extras = [];
var finishers = [];
for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) {
var keys = placements[element.placement];
keys.splice(keys.indexOf(element.key), 1);
var elementObject = this.fromElementDescriptor(element);
var elementFinisherExtras = this.toElementFinisherExtras( (0, decorators[i])(elementObject) || elementObject);
Adding legacy: true
in Babel configuration fixes the issue (but creates a failure somewhere else). The issue is for sure not in the typescript-json-serializer package itself. I think we can close this issue.
['@babel/proposal-decorators', {
legacy: true
}]
Thank you for your investigation, yes it seems 😕
I am getting the same issue. I am using it in cloud functions
I am not sure what happened, i was using JSdoc comments, and it was fixed after i removed the comments.
Hi, could you open a new issue please and follow the instructions to describe the problem?
After adding an import to the following class, I'm facing an error: