Closed iDVB closed 2 years ago
Thanks for the repro project. I think the source files are missing in it though, extraction doesn't work (src/**/*.{js,jsx,ts,tsx} does not exist
).
However, I see that discardOldKeys
is set to true
in your config, and there was a fix related to this option in the latest pre-release (0.9.0-rc.1
). Would you mind trying with it?
Sorry, the src files are now added. Going to try the RC version as well.
@gilbsgilbs Yup!
That RC (0.9.0-rc.1
) fixed the issue.
The output now contains ALL nodes:
{
"InlineComponent": "InlineComponent",
"InlineComponent #2": "InlineComponent #2",
"MyComponent Trans": "MyComponent Trans"
}
Any idea what that version is set to full release?
Just deployed it: https://www.npmjs.com/package/babel-plugin-i18next-extract/v/0.9.0
We are seeing what appears to be a race condition with extract. It does not consistently deliver the common.json locale file if ran more than once.
How to reproduce https://github.com/iDVB/i18next-extract-issue
Setup and run extract
Inspect
i18next-extract-issue/locales/en-US/common.json
It should have one of two results:OR
Continue to rerun
yarn extract
while watching that same file and you should notice that intermittently it will produce one of the two results above. Back and forth in no apparent order and seems random. This appears to point to some kind of race condition.Expected behavior
All 3x nodes are extracted to JSON file.
What actually happens
It flips back and forth between producing one of the outcomes or the other.
Your environment