Skip to content

Using mobx' @observable annotation together with mobx-keystone #533

Answered by xaviergonz
hcschuetz asked this question in Q&A
Discussion options

You must be logged in to vote

That's because you are using vite, which actually uses esbuild to compile TS files rather than tsc internally, and esbuild does not transpile the new decorators yet (evanw/esbuild#104).

If at least the browsers would support them then the lack of transpilation would be ok, but the new standard decorators are still in stage 3 of TC39 and no browsers have yet implemented them (https://caniuse.com/decorators).

If you want to use them then you need to either use tsc to compile the code or pass the esbuild code through babel with the new decorators plugin.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hcschuetz
Comment options

Answer selected by hcschuetz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants