You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Lingui extract can't process some of my files, with an error telling me that I need to update babel config. However, it ignores babel config (both .babelrc and babel.config.json).
To Reproduce
Create .babelrc. Run BABEL_SHOW_CONFIG_FOR=some_file_in_repo lingui extract. Witness the config is not picked up.
Expected behavior
The babel config is respected, or - better - can be configured through lingui.config.json.
Additional context
Error:
Cannot process file .../src/lib/ai/strategies/events1.ts: Support for the experimental syntax 'importAttributes' isn't currently enabled (12:70):
> 12 | import ActionsSchema from "@/lib/ai/strategies/schemas/actions.json" assert { type: "json" };
Add @babel/plugin-syntax-import-attributes (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes) to the 'plugins' section of your Babel config to enable parsing.
If you already added the plugin for this syntax to your config, it's possible that your config isn't being loaded.
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration:
npx cross-env BABEL_SHOW_CONFIG_FOR=.../src/lib/ai/strategies/events1.ts <your build command>
See https://babeljs.io/docs/configuration#print-effective-configs for more info.
SyntaxError: .../src/lib/ai/strategies/events1.ts: Support for the experimental syntax 'importAttributes' isn't currently enabled (12:70):
jsLingui version lingui --version: 9.3.1
Babel version npm list @babel/core@babel/core@7.25.2
Macro support:
I'm using SWC with @lingui/swc-plugin
I'm using Babel with babel-macro-plugin
I'm not using macro
Your Babel config (e.g. .babelrc) or framework you use (Create React App, NextJs, Vite)
The text was updated successfully, but these errors were encountered:
I think you have a newer import syntax in your files which is not supported by babel version used in lingui. What we can do in that case is update babel to support new features which became stage3
Describe the bug
Lingui extract can't process some of my files, with an error telling me that I need to update babel config. However, it ignores babel config (both
.babelrc
andbabel.config.json
).To Reproduce
Create
.babelrc
. RunBABEL_SHOW_CONFIG_FOR=some_file_in_repo lingui extract
. Witness the config is not picked up.Expected behavior
The babel config is respected, or - better - can be configured through lingui.config.json.
Additional context
Error:
lingui --version
: 9.3.1npm list @babel/core
@babel/core@7.25.2
@lingui/swc-plugin
babel-macro-plugin
.babelrc
) or framework you use (Create React App, NextJs, Vite)The text was updated successfully, but these errors were encountered: