Uncaught TypeError: Cannot read property 'createLTR' of undefined
See original GitHub issueHi 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:
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:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try https://github.com/airbnb/react-dates#initialize
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.