-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
IntlRelativeFormat not working in npm build of react-intl@next #166
Comments
What version of Browserify are you using, this is a known Browserify bug, if you update to the latest it should go away. Reopen if that doesn't fix it. |
I wasn't using browserfy at all, it was exactly the file uploaded to npm, so whoever built and uploaded the package to npm will need to update browserfy. For now I can rebuild using the latest browserfy. |
Okay I see the issue now… |
I traced this down to the |
…ed (#166) throw error if void element is being used
Steps to see the bug:
Use a simple html file such as
Disable javascript source maps (I use chrome, it is in the settings). Then place a breakpoint on line 2787 in
react-intl.js
. The relavent lines arewhere the last line is line number 2787. When the breakpoint pauses at the last line, use the console to see that
_intlMessageFormat
and_intlRelativeFormat
are identical and both equal to the MessageFormat class. Somehow, therequire(14)
call is pulling in the MessageFormat class instead of the RelativeFormat. Looking atreact-intl.js
, the RelativeFormat class seems to be in 15, not 14. Since _intlRelativeformat variable contains MessageFormat, I get an error later when using the FormattedRelative element. In particular, the MessageFormat class is passed the locale as the message to translate and an empty object for the locales.Looks like some bug in browserfy during the dist step? I looked through the source code and it seems that it imports intl-relativeformat correctly.
The text was updated successfully, but these errors were encountered: