Closed nickbrit closed 6 years ago
:+1: Me too
pedestrian question... BUT.... do you have moment
and moment-range
imported
@nickbrit Are you still facing this issue?
I am seeing this as of today. Any updates?
Have the same issue when using the module from npm. But if I used the source from github it seems to work. Also find out it's not suitable if you want only a single picker. So I switched now to https://hacker0x01.github.io/react-datepicker/ it works perfect with redux-form
I get the similar problem in my CI environment but not when I am running the app locally. In both cases I use production build of JS bundle. It is obfuscated (thanks UglifyJS), so the message is a little bit different but after investigation it becomes obvious that I've run into the same issue.
It looks like this statement:
require('moment-range');
which comes after this one:
var _moment2 = _interopRequireDefault(_moment);
does not actually change the _moment2["default"] instance in some circumstances.
My CI environment is Codeship (Ubuntu) and this error is 100% reproduced there when I am running my integration tests. Both when app is deployed locally (OS X) and on production (a droplet on DigitalOcean with Ubuntu) there is no problem.
Apparently there is no dependency on Node or NPM. I tried different versions and got the same result.
I suspect that there is some difference in JS engines which are used in Chrome and Firefox on different operating systems. I get similar symptoms in both browsers. My conclusion is that Chrome/Firefox process JS code generated by Webpack differently under different operating systems. It explains all symptoms but does not unfortunately give a clue how to fix it. :-(
Any ideas someone? Except for switching to another plug-in?
I have just tested it. Apparently it depends on the operating system but not the way I thought.
When bundle is generated under OS X it works even when the app is viewed in Chrome under Ubuntu (at least my integration test passed successfully). When bundle is generated under Ubuntu (in my setup) I get the error mentioned in the issue.
It looks like an issue in Webpack rather than in moment-range.
Well, using a fresh install definitely helps. Dependency cache was my enemy, now the problem is gone completely.
hm... have the same issue on ubuntu, on mac os it's ok.
@yrik if you are still having issues, would you mind specifying what version of moment range you have in your mac and Ubuntu installs
Also ensuring that your babel loader isn't accidentally being run over third party dependencies would be a good sanity check too
I just had this issue and it ended being resolved when I deleted node_modules, npm cache clear
and npm install
. Then there are no issues for some odd reason...
I don't use react-daterange-picker but ran into this same issue (symptoms exactly as described by @szubtsovskiy). Reinstalling the dependencies (as described above) and rebundling helped.
When I use yarn
, this error occurs. delete node_modules
and npm install
solve the problem.
Still having this issue, none of the above fixes are working for me.
For anyone still landing on this. It was fixed for us if you properly extend moment with moment range (see moment range docs)
import Moment from 'moment'
import { extendMoment } from 'moment-range'
const moment = extendMoment(Moment);
This should be fixed now by the latest version, please open a new issue if this is still happening after upgrading :+1:
I get this error after reinstall npm module.