Compiler error using @key decorator
See original GitHub issueI have tested the simpler subscription examples successfully, and now I am trying autosubscriptions using the @key decorator, such as in your example:
@autoSubscribe
getTodosForUser(@key username: string) {
return this._todosByUser[username];
}
Unfortunately, I get a compiler error:
Error: Module parse failed: Unexpected character ‘@’ (1:20609) You may need an appropriate loader to handle this file type.
It seems like Babel has a problem with the @key decorator being used within a function, and not with other decorators like @autoSubscribe and @AutoSubscribeStore.
I’ve checked my babel.config.js and everything seems OK, using:
const plugins = [
['@babel/plugin-proposal-decorators', { legacy: true }],
["@babel/plugin-proposal-class-properties", { "loose": true}]
];
Did someone else come across this problem? Any recommendation on how to solve this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (2 by maintainers)
Top Results From Across the Web
Insert with object as key fails to compile? - Stack Overflow
I don't understand the error thrown out by the compiler. Some code to illustrate the problem is below. #include <map> using namespace std; ......
Read more >Method decorator compile to ES5 get error #6865 - GitHub
When i am creating class with function like below it is giving me PropertyDescriptor undefined for method decorator. function editable(value : ...
Read more >Error Handling in Compiler Design - GeeksforGeeks
An Error is the blank entries in the symbol table. Errors in the program should be detected and reported by the parser. Whenever...
Read more >Compile Errors | Online Documentation for Altium Products
To open the Compile Errors panel, click the Design Compiler button at the bottom-right of Altium Designer and select the Compile Errors entry...
Read more >Common Flutter errors
This page explains several frequently-encountered Flutter framework errors and gives suggestions on how to resolve them. This is a living document with more ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
Hi @thegalah,
Thanks for the feedback, I had a quick fix in
1.0.9
. Hope all good if you try with this version.Several of the unit tests use @key. You can start with one of those build systems.