Closed balanceiskey closed 10 years ago
Does it makes sense to remove the "use strict' requirement there? Is that the issue?
I'm working around this by using jsx?harmony
Webpack loader and original ES6 Dispatcher.js
file with my own 'use strict'
added at the very top.
Just ran into this as well...
The dispatcher does work in Chrome. But it does not work while you're using source maps, correct? I believe the issue is the "use strict" declaration that is getting inserted by gulp-react during the transformation from ES6 with the harmony: true
option.
https://github.com/facebook/flux/blob/master/Gulpfile.js#L19
Fastclick was dealing with a similar issue: https://github.com/ftlabs/fastclick/pull/270 https://github.com/ftlabs/fastclick/pull/288
This might be an issue for Chrome devtools, or maybe for gulp-react? Not sure Flux is the correct place to correct it, but I'm totally open to suggestions on what band-aid we should provide in the mean time.
@fisherwebdev For me, putting 'use strict'
at the top of Dispatcher.js
helps: it no longer generates 'use strict'
inside functions, and thus doesn't break eval
in Chrome.
We're not going to be changing the class transforms which is adding the inner 'use strict'
s (in jstransform
via react-tools
) so I think doing what @gaearon says and putting 'use strict'
at the top of the file is the right move.
:+1: Thanks!
_prefix is not defined
I'm actually experiencing this issue because we're using react-router which in turn uses Flux. It's been referenced over in Webpack's issues, but it doesn't appear to be a Webpack issue:
https://github.com/webpack/webpack/issues/417 http://jsfiddle.net/rokkkjcs/1/