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:

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",
Meant to mention that in the component loading the DateRangePicker I already have the following at the top of the file:
import 'react-dates/initialize';
import {DateRangePicker} from 'react-dates';
import 'react-dates/lib/css/_datepicker.css';
No matter where I add the import 'react-dates/initialize'; it seems to have no effect.
So coming back to this I found how to overcome this issue for anyone who encounters the same issue.
During my build I split the "app" code (bundle.js) from the dependencies (vendor.js). Doing so seems to interfere with the initialise function.
The workaround is to remove both react-dates and react-with-styles from the vendor.js and add them to the bundle.js and 馃挜 goes the issue.
The splitting should be fine as long as the module cache spans split bundles.
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.
Most helpful comment
Try https://github.com/airbnb/react-dates#initialize