question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cldrjs errors with React 0.26.2

See original GitHub issue

My 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:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joshswancommented, Nov 26, 2016

Thanks for those fixes @rxaviers. It seems to work. I’ll update this package during the week

1reaction
rxavierscommented, Nov 26, 2016

Cldrjs 0.4.8 updated with such fix. Please, try using it and If you find any trouble, just let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

rxaviers/cldrjs: Simple CLDR traverser - GitHub
CLDR Errors. E_MISSING_BUNDLE. Thrown when none of the loaded CLDR data can be used as a bundle for the corresponding locale.
Read more >
"Can't resolve 'cldr'" error occurs when using Angular-CLI ...
DevExpress Support Team: CLONED FROM T627135: Reporting - ASP.NET Core Support - Preview in v18.1] I'm trying this ctp, I'm using angular-c.
Read more >
Using globalize with webpack 2 and typescript - Stack Overflow
I did the following steps to use globalize.js in typescript project. 1. Install the library npm install globalize npm install @types/ ...
Read more >
所有库 - 基于CDNJS.COM的前端开源库文件快速浏览搜索平台
库名 最新版本 描述 16pixels 0.1.12 16pixels as a node packaged module 6pac‑slickgrid 3.0.2 A lightning fast JavaScript grid/spreadsheet 6px 1.0.3 Javascript client for 6px
Read more >
react-native-globalize - bytemeta
Currency Digits · Cldrjs errors with React 0.26.2 · 'undefined is not an object' when using <FormattedDate> · "Unable to resolve module" -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found