Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch action not working with local server #14

Closed
guijesuis opened this issue Jul 13, 2016 · 5 comments
Closed

Dispatch action not working with local server #14

guijesuis opened this issue Jul 13, 2016 · 5 comments
Labels

Comments

@guijesuis
Copy link

guijesuis commented Jul 13, 2016

Hello, i am looking for some lights.

I am having the following issue when i try to dispatch an action.

VM159:1 Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' blob: filesystem: chrome-extension-resource:".


    at eval (eval at evaluate (unknown source), <anonymous>:1:1)
    at t.launchAction (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:18:15064)
    at Object.r (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:2:4128)
    at a (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:2:2436)
    at Object.s [as executeDispatchesInOrder] (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:2:2651)
    at f (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:1:31158)
    at d (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:1:31284)
    at Array.forEach (native)
    at n (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:2:4605)
    at Object.processEventQueue (chrome-extension://fjmodhjfipejfmnndmebgjimlcklhkgm/js/app.bundle.js:2:246)(anonymous function) @ VM159:1t.launchAction @ app.bundle.js:formatted:32748r @ app.bundle.js:formatted:2157a @ app.bundle.js:formatted:2066s @ app.bundle.js:formatted:2076f @ app.bundle.js:formatted:1894d @ app.bundle.js:formatted:1901n @ app.bundle.js:formatted:2191processEventQueue @ app.bundle.js:formatted:1949r @ app.bundle.js:formatted:4608handleTopLevel @ app.bundle.js:formatted:4614i @ app.bundle.js:formatted:6189perform @ app.bundle.js:formatted:2802batchedUpdates @ app.bundle.js:formatted:6161i @ app.bundle.js:formatted:2506dispatchEvent @ app.bundle.js:formatted:6240

and here is the issue

t.prototype.launchAction = function() {
...
  if ("default" !== this.state.selectedActionCreator) {
    ..  
  } else
     e = new Function("return " + this.refs.action.textContent);
  ...
}

I am running a remotedev-server, and a redux store running on node Js, and chrome App version of remotedev-app.

Does anyone know why it is throwing an exception in this context?

@zalmoxisus zalmoxisus added the bug label Jul 13, 2016
@zalmoxisus
Copy link
Owner

Hi. Thanks for the report. It's not possible to use eval (new Function) in Chrome Apps. A workaround for now would be to use web version, the extension or any other implementation from here.

@guijesuis
Copy link
Author

thank you @zalmoxisus.

I had no idea it was impossible. Is it the only known limitation for this version and what about others? May be we could add a warning in the documentation.

@zalmoxisus
Copy link
Owner

It's just a limitation for Chrome Apps. The solution would be to do eval (new Function) on client side, not in the app, but to do that we need to have our implementation for Dispatch Monitor. Or just deprecate Chrome app in favour for Chrome extension instead (which doesn't have this limitation).

@zalmoxisus
Copy link
Owner

I'll keep this open, and try to fix.

@zalmoxisus zalmoxisus reopened this Jul 26, 2016
zalmoxisus added a commit that referenced this issue Jul 31, 2016
zalmoxisus added a commit to zalmoxisus/remote-redux-devtools that referenced this issue Aug 1, 2016
@zalmoxisus
Copy link
Owner

Fixed in v0.6.0.

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

No branches or pull requests

2 participants