Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Dispatcher fails in Chrome #45

Closed
balanceiskey opened this issue Sep 3, 2014 · 7 comments
Closed

Dispatcher fails in Chrome #45

balanceiskey opened this issue Sep 3, 2014 · 7 comments

Comments

@balanceiskey
Copy link

_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:

webpack/webpack#417
http://jsfiddle.net/rokkkjcs/1/

@balanceiskey
Copy link
Author

Does it makes sense to remove the "use strict' requirement there? Is that the issue?

@gaearon
Copy link

gaearon commented Sep 3, 2014

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.

@KyleAMathews
Copy link

Just ran into this as well...

@fisherwebdev
Copy link
Contributor

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:
ftlabs/fastclick#270
ftlabs/fastclick#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.

@gaearon
Copy link

gaearon commented Sep 4, 2014

@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.

@zpao
Copy link
Contributor

zpao commented Sep 7, 2014

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.

fisherwebdev added a commit that referenced this issue Sep 10, 2014
fix #45: Dispatcher fails in Chrome
@gaearon
Copy link

gaearon commented Sep 10, 2014

👍 Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants