js-lingui
js-lingui copied to clipboard
"cli extract" fails when I do not use macro and have no babel macro package installed
Describe the bug
I'm using Next.js. I do not need macros, so I decided not to install @babel/macro etc. I did it because I want Next.js to use SWC.
To Reproduce
Create a minimal Next.js project.
Do not install anything related to macros.
Run yarn extract
.
Console logs gets lots of warnings - lingui-extract.js
tries to use babel-plugin-macros
.
Expected behavior
extract/compile should work without babel-plugin-macros
dependency.
Additional context
-
jsLingui version
3.13.2
-
Your Babel config (e.g.
.babelrc
) - Next.js; no custom babelrc config.
As workaround, you can add
extractBabelOptions: {
presets: ['next/babel'],
},
in lingui.config.js
Lingui heavily depends on macro's to work, and SWC doesn't have yet anything around macros. I'm sorry
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
What's the idea behind automatically closing issues that are not rejected explicitly? If nobody can take care of it now, it does not mean the issue automagically becomes irrelevant or not actual. It is still actual.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Has it been completed, actually?
This won't get done ever. We use babel-plugin-macros for extracting the t``. Until SWC opens a way to interact with the AST code we CAN'T do nothing.