zalmoxisus / remotedev-app

Remote Redux DevTools monitor app.

Home Page:http://remotedev.io/local

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dispatch action not working with local server

guijesuis opened this issue · comments

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?

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.

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.

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

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

Fixed in v0.6.0.