ngduc / react-setup

A Universal React Setup with i18n: Babel 6, Koa 2, React, React Router, React Transmit, React Bootstrap, React-intl, Mocha, Isparta, Webpack 2, Storybook, InlineCSS/PostCSS, ESLint, HTTPS & HTTP2.
MIT License
175 stars 16 forks source link

Checksum problems #8

Closed prewk closed 8 years ago

prewk commented 8 years ago

It seems to be server-rendering in English and then client rendering in Japanese with the ?locale=ja-JP param. This causes a console error.

ngduc commented 8 years ago

Production build does not have that error. (npm run build && npm start) Server still renders Eng version first, then apply JP strings right away (it flickers a few ms). I'm trying to make it render with locale strings completely.

ngduc commented 8 years ago

@prewk Hi, I've just committed a fix for this: https://github.com/ngduc/react-setup/commit/b039dcdb6b56eec2e9e7672f2cee56498103e2a1

Could you let me know if that works?

ngduc commented 8 years ago

Fixed in https://github.com/ngduc/react-setup/issues/10

prewk commented 8 years ago

Confirmed!

react-intl is complaining about having to use fallbacks in English:

[React Intl] Missing message: "home.welcome" for locale: "en-US", using default message as fallback.formatMessage
...

I have the same problem in another project. They changed the API so that it console.errors instead of just using the fallback, which IMO is unfortunate.

Thought you'd wanna know.

ngduc commented 8 years ago

I think they'll fix it soon, or we have to patch console.log: https://github.com/yahoo/react-intl/issues/251

prewk commented 8 years ago

That's good news. I use it in another project and I hate those errors.

ngduc commented 8 years ago

This is fixed by setting defaultLocale which I've just committed. https://github.com/ngduc/react-setup/commit/a3028754ad456fdc2d77152f3ee1f80b979ec8ad