Cldrjs errors with React 0.26.2
See original GitHub issueMy project works with 0.25 (thanks for the recent fixes!), but upgrading to 0.26.2 (with react 15.0.2), I get a different set of problems:
Cannot read property 'init' of undefined
<unknown>
event.js @ 547:0: superInit = Cldr.prototype.init;
pathNormalize
event.js @ 22:0: module.exports = factory( require( "cldrjs" ) );
<unknown>
event.js @ 25:0: factory( Cldr );
loadModuleImplementation
require.js @ 100:0: ....
...more require.js...
<unknown>
node_main.js @ 20:0: require( "./cldr/event" );
...more require.js...
Looks like importing cldrjs
imports node_main.js
imports cldr/event.js
imports cldrjs
(which is technically a cycle). In theory the fact that node_main.js
sets module.exports
before importing cldr/event.js
should help?
Regardless, when node_main.js
sets module.exports, it is a valid Cldrjs
class object. Unfortunately, when cldr/event.js
imports it via cldrjs
, it is an empty object. I have no idea why this is, or why this apparently changed when I upgraded from react-native 0.25.x to 0.26.2.
It also looks to be entirely within cldrjs, but again given that it’s the react-native upgrade is triggering this problem, I doubt the cldrjs folks will care much about the problem. So I’m filing it here in react-native-globalize, as that’s the import that manifests itself to me and the border between cldrjs and RN.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Thanks for those fixes @rxaviers. It seems to work. I’ll update this package during the week
Cldrjs
0.4.8
updated with such fix. Please, try using it and If you find any trouble, just let me know.