Unexpected token: name (onClickOutside)
Getting an error on webpack production build.
Unexpected token: name (onClickOutside) [./node_modules/react-onclickoutside/index.js:92,0]
It seems to be fixed in react-onclickoutside version 6.1.0 as mentioned here.
https://github.com/Pomax/react-onclickoutside/issues/195
I noticed this has recently been downgraded, but version 0.57.0 won't build for me and others.
I released 0.58 which should fix this problem I believe.
We downgraded from 6.1 to 6.0 to fix this problem.
Oh wait, sorry my bad. 0.57 should fix the issue based on https://github.com/Hacker0x01/react-datepicker/pull/1083. Can you describe what's not working for you?
I'm not sure how much details I can give, but what I can tell you is that using 0.54 works fine. When I bump to 0.57 it breaks and this is only happening when running a webpack production build.
Node: 8.1.2 Webpack: 3.8.1
Running webpack in development mode (NODE_ENV=development) seems to run just fine. Here is the full error:
[client] container-b8552c-ad11534beeb7ba0bb4d4.js from UglifyJs
Unexpected token: name (onClickOutside) [./node_modules/react-onclickoutside/index.js:92,0][container-b8552c-ad11534beeb7ba0bb4d4.js:1603,33]
Here is the uglify config:
new webpack.optimize.UglifyJsPlugin({
minimize: false,
sourceMap: true,
compress: {
warnings: false,
pure_getters: true,
screw_ie8: true,
comparisons: false,
},
}),
We have the same problem as tadjohnston. The problem only occurs during the webpack production build.
@martijnrusschen Seems to me this is a different problem you've fixed with downgrading react-onclickoutside to 6.0.0.
The problem I, @tadjohnston and @josegers have is that, ./node_modules/react-onclickoutside/index.js in v6.0.0 is not transpiled and has native ES6 class defined. This is sth that has been fixed in react-onclickoutside v.6.1.0, but you're using a lower version.
I'm experiencing the same issue with the create-react-app stack. It can't build my application, fails with the message:

+1 here. Reverting to 0.54 seems to be fine. (with react 16 and react-onclickoutside 6.6.2)
Reverting to 0.56.0 works for me.
This is probably fixed by #1091, can anyone pull down master and give it a shot before we cut a release?
@rafeememon : Yes I'm no it!
@rafeememon : I've followed the below process.
cd myproject/node_modules
git clone https://github.com/Hacker0x01/react-datepicker.git
cd ..
npm start // it works fine
npm run build // gives below error
error
ERROR in formFlowStructure.bundle.js from UglifyJs
Unexpected token: name (onClickOutside) [formFlowStructure.bundle.js:48997,33]
It works fine with react v16, react-datepicker v0.56.
I'm pretty out of the loop here but maybe @Andarist knows what might be going on?
@rafeememon it seems that this was fixed by recently merged in https://github.com/Hacker0x01/react-datepicker/pull/1091 , ofc I might be wrong, as I didn't dig into the issue properly, but from what I read here it is highly possible
The only thing left to do is releasing a new version of react-datepicker
I'm a bit hesitant of releasing a new version, but I'll cut a patch release so we can give people access to the latest version to play with.
Oh i didn't mean a major new version, just an updated one - patch, minor, whatever :P
I have same issue while building to production with react16
It is a bummer

@aniruddhashevle I'm not sure that's enough to run the new version. You'll also need to pull in the latest version of react-onclickoutside.
I have the same issue while building to production with react 15.6.2