Replies: 1 comment
-
Turbopack currently has limited support for the newest @decorators syntax, especially the newer Stage 3 decorators proposal that includes things like accessor. The error message you’re seeing:
indicates that Turbopack’s Rust-based compiler does not yet support this accessor decorator syntax. What you need to know: experimentalDecorators flag in tsconfig is not relevant to Turbopack’s internal parser, since it uses SWC or its own Rust parser. Currently, Turbopack does not support Babel loaders/plugins directly, so using babel-loader as a fallback isn’t straightforward. Workarounds: Stick to next dev or Webpack-based builds for now if you need Stage 3 decorator support, as those use Babel which has better support. Track Turbopack’s GitHub repo and roadmap for upcoming support for these newer decorator features. Alternatively, you might try to precompile the problematic files with Babel or tsc before Turbopack handles them, but this adds complexity. Summary |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi, I'm trying to use turbopack with a legacy project that uses mobx + decorators. Mobx supports "2022.3/Stage 3" decorators which does not require the tsconfig "experimentalDecorators" flag. However, when I run my project I get a compilation error, the reason given being:
not implemented: ClassMember::AutoAccessor(AutoAccessor
It points to the following file, which contains a common pattern in my code base:
@observable accessor language = 'en'
I can't find any documentation on turbopack on if this is supported and I cannot remove accessor as it's required by mobx. The only thing I can see as a potential route is to use a babel-loader with turbopack, but again can't find much documentation on that.
Any pointers are greatly appreciated. Thanks.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions