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.

Uncaught TypeError: Cannot read property 'createLTR' of undefined

See original GitHub issue

Hi There - been battling with this for hours unsuccessfully. I keep getting the error Uncaught TypeError: Cannot read property ‘createLTR’ of undefined when I load the DateRangePicker component:

Screenshot 2019-07-11 at 18 44 12

Not using webpack as in the examples but browserify to bundle up the app.js seperately to the dependencies, might this be causing the problem?

gulp.task('vendorScripts', function () {
  // Ensure package is updated.
  readPackage();
  var vb = browserify({
    debug: true,
    require: pkg.dependencies ? Object.keys(pkg.dependencies) : []
  });
  return vb.bundle()
    .on('error', gutil.log.bind(gutil, 'Browserify Error'))
    .pipe(source('vendor.js'))
    .pipe(buffer())
    .pipe(sourcemaps.init({loadMaps: true}))
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest('.tmp/assets/scripts/'))
    .pipe(reload({stream: true}));
});

Versions of the various packages:

"react": "16.8.6",
"react-dates": "^20.2.5",
"react-dom": "16.8.6",
"browserify": "^16.2.2",

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
ljharbcommented, Jul 11, 2019
6reactions
reZachcommented, Dec 23, 2019

This is still a issue in December. Has this not gotten fixed yet in the master branch? I am not doing anything with a bundle as @rustyb describes - so I am stuck how to fix this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'createLTR' of undefined #137 - GitHub
Ussing: https://github.com/airbnb/react-dates server render Cannot read property 'createLTR' of undefined TypeError: Cannot read property ...
Read more >
Cannot read property 'create' of undefined -- react-dates error
I got the same error in my tests and adding import 'react-dates/initialize'; fixed it.
Read more >
Cannot read property 'createLTR' of undefined - Bountysource
server render. Cannot read property 'createLTR' of undefined TypeError: Cannot read property 'createLTR' of undefined at Object.
Read more >
Javascript – Cannot read property 'create' of undefined — react ...
Uncaught TypeError : Cannot read property 'create' of undefined at Object.createLTR [as create] (ThemedStyleSheet.js?17e6:46) at WithStyles.
Read more >
Cannot read property 'createLTR' of undefined 에러가 발생 ...
Cannot read property 'createLTR' of undefined 에러가 발생하는 경우 해결방법. 2018년 12월 14일. react-dates를 사용할 때 대부분 아래와 같이 임포트 후 사용한다 ...
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