Open andrew-luhring opened 9 years ago
This is a node issue, not a grunt or grunt-contrib-watch issue. Your version of node doesn't support arrow functions.
request.js
is only parsed once when you start grunt. That's why changing it while grunt is running doesn't cause an error. To prove this, change the message being logged within request.js
while grunt is running. You'll see the new message does not get logged.
I was using the latest version of node at the time... so I don't think that's the case.
Was this ever resolved, as I'm hitting the same issue? My version of node.js is v6.9.5, and arrows support has been available since v6.4.0 (according to https://node.green/)
Not completely sure whether this is a grunt-contrib-watch issue or a grunt issue so i'm submitting the issue in both places, but here's my setup and what's happening:
Setup
Gruntfile.js
Request.js
To reproduce issue:
grunt --verbose --debug
Result:
Grunt will the grunt watch task, the grunt-watch task will run request.js, it will break.
^ Grunt fails.
BUT
Now, change request.js to the following.
grunt --verbose --debug
It's fine. No es6, no error.
BUT
NOW- without stopping grunt- change request.js back to:
Result:
IT WORKS FINE.
The first time you run grunt, it doesn't respect es6 (arrow functions at least). But if you run grunt without any es6 at first, THEN ADD ES6 CODE grunt works as expected.
Hence, i'm not sure if this is an issue with grunt or grunt-contrib-watch.