-
Notifications
You must be signed in to change notification settings - Fork 9
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
Property name expected type of string but got null
#34
Comments
I faced the same issue and found out it was due to a regression in Here's a link to my babel.config.js in case you need it. |
This also causes a different error, for example in this minimal demo project: function test(target, property, descriptor) {
}
class Greeter {
@test
greet(@test name) {
}
} is compiled to var _class;
// [...]
let Greeter = (
_class =
(
test(_class /* <-- this is undefined */.prototype, "greet", 0), class Greeter {
greet(name) {
}
}
), (
_applyDecoratedDescriptor(
_class.prototype,
"greet",
[test],
Object.getOwnPropertyDescriptor(_class.prototype, "greet"),
_class.prototype,
)
), _class
); which then throws when executing
The workaround also fixed that issue. |
reference:WarnerHooh/babel-plugin-parameter-decorator#34 Co-authored-by: chenfuqiang <[email protected]>
I created a new plugin: babel-plugin-typescript-decorators . it is modified from @babel/plugin-proposal-decorators. It will process parameter decorators before |
@wmzy This is great! Thanks for sharing. I see the code was pushed a few months ago, are you already using this plugin in production? |
@guyca Yes. |
@wmzy If the only change is the order in which decorators are processed? Do you think we can submit a PR to Babel instead of forking the decorator's plugin? |
@guyca I don't think babel wants to support this syntax feature. Because it's just an experimental feature of TS and is likely to be deprecated. |
Hello,
Firstly, thank you very much for this babel plugin.
We're seeing the following exception on build
Reproduce repo: https://github.com/wmzy/test-decorator .
Note the
.browserslistrc
ischrome > 80
.The text was updated successfully, but these errors were encountered: