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
The documentation about lazy translations shows how you can use defineMessage and pass it to either Trans or i18n._(). When I use i18n._(), extracting messages prints out Missing message ID, skipping. warnings.
To Reproduce
You can use the code provided in the documentation and run lingui extract:
Expected behavior
Both methods should work the same, without printing warnings.
Additional context
Add any other context about the problem here.
jsLingui version 3.17.1 (yarn lingui --version prints "dev"?)
Babel version 7.20.12
Your Babel config (e.g. .babelrc) or framework you use (Create React App, Meteor, etc.)
using "@lingui/swc-plugin": "^0.2.0"
with Next.js in a JS codebase
// lingui.config.jsextractBabelOptions: {presets: ['@babel/preset-react'],},// next.config.jsexperimental: {swcPlugins: [['@lingui/swc-plugin',{// the same options as in .swcrc},],],},
The text was updated successfully, but these errors were encountered:
Yes, that's a bug. Unfortunately there are no obvious solution, because either it's break backward compatibility with existing code or will disable this validation at all, which is also kinda breaking change.
I will definitely consider this issue in v4. Thanks for reporting.
As for now, as workaround you can rename i18n object to something and pass descriptor into it. The extractor matching only by identifier name, so this would work
Describe the bug
The documentation about lazy translations shows how you can use
defineMessage
and pass it to eitherTrans
ori18n._()
. When I usei18n._()
, extracting messages prints outMissing message ID, skipping.
warnings.To Reproduce
You can use the code provided in the documentation and run
lingui extract
:Expected behavior
Both methods should work the same, without printing warnings.
Additional context
Add any other context about the problem here.
3.17.1
(yarn lingui --version
prints "dev"?)7.20.12
.babelrc
) or framework you use (Create React App, Meteor, etc.)"@lingui/swc-plugin": "^0.2.0"
The text was updated successfully, but these errors were encountered: