lingui extract
babel config doesn't support experimental syntax 'decoratorAutoAccessors'
#2057
Closed
1 of 3 tasks
Describe the bug
When running
lingui extract
in a codebase that uses decoratorAutoAccessors, babel will throw aSyntax Error: Support for the experimental syntax 'decoratorAutoAccessors' isn't currently enabled
.Babel config used during extraction:
To Reproduce
Steps to reproduce the behavior, possibly with minimal code sample, e.g:
Expected behavior
In my case I'd simply expect lingui extract to properly handle accessor syntax, however in the bigger picture I'd expect the extracter to parse the code with the same config that I've defined in my vite.config.ts (in this case). At the very least allowing me to specify the babel config used during extraction would already go a long way.
Additional context
Note that the decoratorAutoAccessors syntax is popular with modern MobX codebases.
lingui --version
: 4.13.0npm list @babel/core
@lingui/swc-plugin
babel-macro-plugin
: "babel-plugin-macros": "^3.1.0".babelrc
) or framework you use (Create React App, NextJs, Vite)Vite with plugin-react:
react({ babel: { plugins: [['@babel/plugin-proposal-decorators', { version: '2023-11' }], 'macros'] } }),
The text was updated successfully, but these errors were encountered: