-
Notifications
You must be signed in to change notification settings - Fork 122
File opts.messagesDir not created because descriptors.length == 0 #92
Comments
There hasn't been any changes to the code that actually writes out of the |
The test repo I made is very reduced and set up according to the setup instructions. Please try this to reproduce the problem:
an error occurs because the directory extracted-messages was not created. then downgrade:
voilà - it works - the directory "extracted-messages" was created. after upgrading with
the error occurs again because 2.3.0 doesn't create the directory "extracted-messages". |
@ericf could you please have a quick look at the repo https://github.com/googol7/test-babel-plugin-react-intl what’s wrong with my setup? |
I am having a similar issue with I will roll back and see when this issue started. |
@ericf I can confirm that as of Specifically, Additionally, I have found a work around.
// .babelrc
{
"env": {
"i18n": {
"plugins": [
["react-intl", {
"enforceDescriptions": true,
"messagesDir": "./src/i18n/messages"
}]
]
}
}
} (obviously environment isn't needed, but running |
I haven't had a chance to look at this yet. If you guys see anything in the commits between the versions that work and don't work let me know, or send a PR if you find a fix. |
I see the README docs encourage someone to end up adding the plugin twice, once via If you guys remove |
@ericf thanks! |
I was able to reproduce and |
Alright I figured out a fix for this issue without warning. It Just Works™ |
This fixes issues without writing the extracted messages out to the filesystem when multiple instances of the plugin are being applied. This also removes the CLI usage docs which say to use `--plugins` option because this is not useful for this plugin since it needs to be configured via `.babelrc` or use via Babel's API. Fixes #92
This fixes issues without writing the extracted messages out to the filesystem when multiple instances of the plugin are being applied. This also removes the CLI usage docs which say to use `--plugins` option because this is not useful for this plugin since it needs to be configured via `.babelrc` or use via Babel's API. Fixes #92
@ericf not sure what changed, but your comment above makes sense. I tried to use When I just leverage Either way I am updating my code to match the snippet above since what you said makes sense. |
If you configured the plugin with Essentially what I did was allow the plugin to work as expect, even when it's being included more that one time. I was able to do this without having to add warnings. There's also no way for me to detect in the plugin whether it was added via |
Right i was using Thanks for the help! |
Not sure why. I tested it this way and saw the issue, then with my changes the issue was fixed. |
@ericf your fix in |
The directory defined in opts.messagesDir is not being created with version > 2.1.4
commit 48b7d47 is the first one that doesn’t work anymore.
created a repo here for you to test:
https://github.com/googol7/test-babel-plugin-react-intl
babel-plugin-react-intl@2.1.4 works
babel-plugin-react-intl@2.2.0 doesn’t work anymore
babel-plugin-react-intl@2.3.0 doesn’t work either
please try these commands:
or
I suppose it’s connected to these issues where the command is run twice and the second time
descriptors.length == 0
:#28
#25
Is there something wrong in my configuration or is there a bug with versions > 2.1.4?
The text was updated successfully, but these errors were encountered: