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
{{ message }}
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.
I'm in the process of upgrading to babel 6 and noticed this plugin throws an error because of missing description field (with enforceDescriptions: true).
All my messages have the description field, so this is not the problem (also it was working with babel 5).
For example, given this message
constmessages=defineMessages({builtWith: {id: 'footer.builtWith',description: 'Mention how the site is built with',defaultMessage: 'This site is built with <3 using {link}'}})
I get the following error
SyntaxError: lib/components/Footer.js: [React Intl] Message must have a `description`.
2 | import { defineMessages, FormattedMessage } from 'react-intl'
3 |
> 4 | const messages = defineMessages({
| ^
5 | builtWith: {
6 | id: 'footer.builtWith',
7 | description: 'Mention how the site is built with',
If I log the descriptor argument and state.opts of the storeMessage function I see that it's called multiple times
{ id: 'footer.builtWith',
description: 'Mention how the site is built with',
defaultMessage: 'This site is built with <3 using {link}' } {}
{ id: 'footer.builtWith',
defaultMessage: 'This site is built with <3 using {link}' } { messagesDir: './_translations', enforceDescriptions: true }
As you can see there are 2 differences here:
the first time description is present, but state.opts is empty
the second time description is somehow missing (thus throwing the error) and state.opts is the options defined for the plugin in .babelrc
I'm in the process of upgrading to babel 6 and noticed this plugin throws an error because of missing description field (with
enforceDescriptions: true
).All my messages have the description field, so this is not the problem (also it was working with babel 5).
For example, given this message
I get the following error
If I log the
descriptor
argument andstate.opts
of thestoreMessage
function I see that it's called multiple timesAs you can see there are 2 differences here:
description
is present, butstate.opts
is emptydescription
is somehow missing (thus throwing the error) andstate.opts
is the options defined for the plugin in.babelrc
PS: my
.babelrc
Any idea what's going on here? Thanks
The text was updated successfully, but these errors were encountered: