Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No output #63

Closed
lensbart opened this issue Jan 13, 2020 · 1 comment
Closed

No output #63

lensbart opened this issue Jan 13, 2020 · 1 comment

Comments

@lensbart
Copy link
Contributor

lensbart commented Jan 13, 2020

Running the extract-messages CLI command, I get empty objects in each of the expected dictionary files.

After digging a bit through the source code, this is the culprit:

presets.unshift({
   plugins: [
     [
       babelPluginReactIntl,
       Object.entries(pluginOptions).reduce((acc, [key, value]) => {
         if (babelPluginReactIntlOptions.includes(key)) {
           return { ...acc, [key]: value }
         }
         return acc
       }, {})
     ]
   ]
 })

Commenting out these lines gets the script in working order.

It seems that the Babel plugin that’s added to the presets array, fails to pass the metadata property along that contains the messages.

All my dependencies are up-to-date.

Hope this helps!

@lensbart
Copy link
Contributor Author

lensbart commented Jan 15, 2020

After 2 days of debugging, I found that this plugin is not compatible with having ['@babel/plugin-transform-react-constant-elements', { allowMutablePropsOnTags: ['FormattedMessage'] }] in the plugins array in .babelrc.js (neither before nor after the react-intl-auto entry).

Perhaps this could be added to README as a caveat

@akameco akameco closed this as completed in 4c929bd Mar 2, 2020
akameco added a commit that referenced this issue Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant