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

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: "script-src 'self'". #10

Open
melcloud opened this issue Aug 31, 2015 · 16 comments

Comments

@melcloud
Copy link

Got following error when trying to edit .json file after upgrading to 0.1.13.

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: "script-src 'self'".
at Function (native)
at Function.line.toFunction (c:\home.atom\packages\json-schema\node_modules\is-my-json-valid\node_modules\generate-function\index.js:55:21)
at compile (c:\home.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:543:23)
at visit (c:\home.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:326:16)
at c:\home.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:523:9
at Array.forEach (native)
at visit (c:\home.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:520:31)
at compile (c:\home.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:537:3)
at module.exports (c:\home.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:564:10)
at c:\home.atom\packages\json-schema\lib\schema-linter.js:45:12
at memoized (C:\Users\yzhang\AppData\Local\atom\app-1.0.9\resources\app.asar\node_modules\babel-core\node_modules\lodash\index.js:7912:27)
at MapObservable.selector (c:\home.atom\packages\json-schema\lib\schema-linter.js:56:49)
at c:\home.atom\packages\json-schema\node_modules\rx\dist\rx.js:4785:67
at tryCatcher (c:\home.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
at InnerObserver.onNext (c:\home.atom\packages\json-schema\node_modules\rx\dist\rx.js:4806:43)
at InnerObserver.tryCatcher (c:\home.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)

@melcloud
Copy link
Author

Mmm... seems it is caused by proxy settings. I just delete the proxy setting from apm, now it stops throwing errors.

@melcloud
Copy link
Author

melcloud commented Sep 2, 2015

Is there anyway to let atom json works behind proxy? It begins to throw all kinds of parsing errors when I try it at work. Make it impossible to edit .json files.

@atsu85
Copy link

atsu85 commented Sep 26, 2015

I'm getting the same error message, but i'm not behind the proxy. @melcloud, why do You think it is related to using proxy server? My stack trace is quite similar, with some line defferences that may be caused by version difference (you can see the diff from https://www.diffchecker.com/kxba1ch9 for one month).

Maybe it helps to reproduce the issue:

  1. i was trying to edit tsconfig.json file (TypeScript configuration file)
  2. i also tried older version of this plugin (0.1.13, 0.1.10, 0.1.8)

@melcloud
Copy link
Author

@atsu85 Like I said, once I delete the proxy setting from apm, everything works. But it seems to be fixed in the latest release. I would close this for now.

@atsu85
Copy link

atsu85 commented Sep 30, 2015

once I delete the proxy setting from apm, everything works

as far as i know, I wasn't using proxy :/ How exactly You deleted proxy settings from apm?

But it seems to be fixed in the latest release

As i said, i tried version 0.1.13, that seems to be the latest version

@david-driscoll
Copy link
Member

sounds like it may be an issue with CSP... I'll try and look at this soon.

@jerone
Copy link

jerone commented Nov 6, 2015

Same error here. I'm not behind any proxy or corporate firewall.

Dup: #15

Atom 1.2.0-beta1
json-schema 0.1.15
Windows 7

@prometheas
Copy link

Also getting this message.

@ghost
Copy link

ghost commented Dec 7, 2015

I just installed the Atom json-schema package (0.1.15) tonight and am seeing the same error trying to edit my package.json file.

@prometheas
Copy link

Editing JSON files with these error messages has become untenable (every key press spawns an error).

@ndaidong
Copy link

Disable or Uninstall "json-schema" package can stop throwing error.

json-schema

@prometheas
Copy link

Any leads here, @david-driscoll ?

@jarrodek
Copy link

jarrodek commented Feb 9, 2016

I have this error right now:

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: "script-src 'self'".
at Function (native)
at Function.line.toFunction (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\node_modules\generate-function\index.js:55:21)
at compile (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:543:23)
at visit (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:326:16)
at C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:523:9
at Array.forEach (native)
at visit (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:520:31)
at compile (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:537:3)
at visit (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:326:16)
at C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:388:9
at Array.forEach (native)
at visit (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:387:18)
at compile (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:537:3)
at module.exports (C:\Users\jarro.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:566:10)
at C:\Users\jarro.atom\packages\json-schema\lib\schema-linter.js:52:12
at memoized (C:\Users\jarro\AppData\Local\atom\app-1.4.1\resources\app.asar\node_modules\babel-core\node_modules\lodash\index.js:7912:27)
at MapObservable.selector (C:\Users\jarro.atom\packages\json-schema\lib\schema-linter.js:63:49)
at C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:4785:67
at tryCatcher (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
at InnerObserver.onNext (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:4806:43)
at InnerObserver.tryCatcher (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
at AutoDetachObserverPrototype.next (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
at InnerObserver.onNext (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:3627:90)
at InnerObserver.tryCatcher (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
at AutoDetachObserverPrototype.next (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
at C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1855:51
at C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1884:13
at scheduleInnerRecursive (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1085:7)
at recursiveAction (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1039:9)
at [object Object].invokeRecImmediate as action
at [object Object].ScheduledItem.invokeCore (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:929:17)
at [object Object].ScheduledItem.invoke (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:917:40)
at runTrampoline (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1237:37)
at tryCatcher (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
at Scheduler.scheduleNow as _schedule
at Scheduler.Rx.Scheduler.schedulerProto.scheduleWithState (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:970:19)
at Scheduler.schedulerProto.scheduleRecursiveWithState (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1104:19)
at Scheduler.schedulerProto.scheduleRecursive (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1094:19)
at ScheduledObserver.Rx.internals.ScheduledObserver.ScheduledObserver.ensureActive (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1875:54)
at ReplaySubject.Rx.ReplaySubject.addProperties.onNext (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.binding.js:410:20)
at ReplaySubject.tryCatcher (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
at AutoDetachObserverPrototype.next (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
at AutoDetachObserver.tryCatcher (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
at AutoDetachObserverPrototype.next (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
at C:\Users\jarro.atom\packages\json-schema\node_modules\rx\dist\rx.js:2323:7
at process._tickCallback (node.js:368:9)

@ChristopherHaws
Copy link

I am receiving these errors any time I try editing my tsconfig.json file and I am not getting any intellisense. When I disable atom-json-schema the errors go away.

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: "script-src 'self'".
    at Function (native)
    at Function.line.toFunction (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\node_modules\generate-function\index.js:55:21)
    at compile (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:542:23)
    at visit (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:325:16)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:387:9
    at Array.forEach (native)
    at visit (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:386:18)
    at compile (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:536:3)
    at module.exports (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:565:10)
    at C:\Users\chris\.atom\packages\json-schema\lib\schema-linter.js:52:12
    at memoized (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\babel-core\node_modules\lodash\index.js:7912:27)
    at MapObservable.selector (C:\Users\chris\.atom\packages\json-schema\lib\schema-linter.js:63:49)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:4785:67
    at tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at InnerObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:4806:43)
    at InnerObserver.tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at AutoDetachObserverPrototype.next (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
    at InnerObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:3627:90)
    at InnerObserver.tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at AutoDetachObserverPrototype.next (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1855:51
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1884:13
    at scheduleInnerRecursive (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1085:7)
    at recursiveAction (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1039:9)
    at [object Object].invokeRecImmediate [as action] (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1056:7)
    at [object Object].ScheduledItem.invokeCore (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:929:17)
    at [object Object].ScheduledItem.invoke (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:917:40)
    at runTrampoline (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1237:37)
    at tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at Scheduler.scheduleNow [as _schedule] (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1248:45)
    at Scheduler.Rx.Scheduler.schedulerProto.scheduleWithState (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:970:19)
    at AnonymousObservable.s [as _subscribe] (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:5248:34)
    at AnonymousObservable.Rx.Observable.observableProto.subscribe.observableProto.forEach (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1976:19)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:2358:14
    at AnonymousObservable.observableProto.toPromise (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:2355:12)
    at Object.exports.provider.lint (C:\Users\chris\.atom\packages\json-schema\lib\schema-linter.js:81:18)
    at promises.push.Promise.then._this.emitter.emit.linter (C:/Users/chris/.atom/packages/linter/lib/linter-registry.js:63:26)
    at C:/Users/chris/.atom/packages/linter/lib/linter-registry.js:62:23
    at Set.forEach (native)
    at LinterRegistry.lint (C:/Users/chris/.atom/packages/linter/lib/linter-registry.js:60:18)
    at file:///C:/Users/chris/.atom/packages/linter/lib/linter.coffee:98:16
    at Function.module.exports.Emitter.simpleDispatch (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
    at C:/Users/chris/.atom/packages/linter/lib/editor-linter.js:80:22
    at file:///C:/Users/chris/.atom/packages/linter/lib/helpers.coffee:23:18


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: "script-src 'self'".
    at Function (native)
    at Function.line.toFunction (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\node_modules\generate-function\index.js:55:21)
    at compile (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:542:23)
    at visit (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:325:16)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:387:9
    at Array.forEach (native)
    at visit (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:386:18)
    at compile (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:536:3)
    at module.exports (C:\Users\chris\.atom\packages\json-schema\node_modules\is-my-json-valid\index.js:565:10)
    at C:\Users\chris\.atom\packages\json-schema\lib\schema-linter.js:52:12
    at memoized (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\babel-core\node_modules\lodash\index.js:7912:27)
    at MapObservable.selector (C:\Users\chris\.atom\packages\json-schema\lib\schema-linter.js:63:49)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:4785:67
    at tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at InnerObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:4806:43)
    at InnerObserver.tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at AutoDetachObserverPrototype.next (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
    at InnerObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:3627:90)
    at InnerObserver.tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at AutoDetachObserverPrototype.next (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:5274:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1710:35)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1855:51
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1884:13
    at scheduleInnerRecursive (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1085:7)
    at recursiveAction (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1039:9)
    at [object Object].invokeRecImmediate [as action] (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1056:7)
    at [object Object].ScheduledItem.invokeCore (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:929:17)
    at [object Object].ScheduledItem.invoke (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:917:40)
    at runTrampoline (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1237:37)
    at tryCatcher (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:567:29)
    at Scheduler.scheduleNow [as _schedule] (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1248:45)
    at Scheduler.Rx.Scheduler.schedulerProto.scheduleWithState (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:970:19)
    at AnonymousObservable.s [as _subscribe] (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:5248:34)
    at AnonymousObservable.Rx.Observable.observableProto.subscribe.observableProto.forEach (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:1976:19)
    at C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:2358:14
    at AnonymousObservable.observableProto.toPromise (C:\Users\chris\.atom\packages\json-schema\node_modules\rx\dist\rx.js:2355:12)
    at Object.exports.provider.lint (C:\Users\chris\.atom\packages\json-schema\lib\schema-linter.js:81:18)
    at promises.push.Promise.then._this.emitter.emit.linter (C:/Users/chris/.atom/packages/linter/lib/linter-registry.js:63:26)
    at C:/Users/chris/.atom/packages/linter/lib/linter-registry.js:62:23
    at Set.forEach (native)
    at LinterRegistry.lint (C:/Users/chris/.atom/packages/linter/lib/linter-registry.js:60:18)
    at file:///C:/Users/chris/.atom/packages/linter/lib/linter.coffee:98:16
    at Function.module.exports.Emitter.simpleDispatch (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
    at C:/Users/chris/.atom/packages/linter/lib/editor-linter.js:30:20
    at Function.module.exports.Emitter.simpleDispatch (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
    at TextBuffer.module.exports.TextBuffer.saveAs (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1067:27)
    at TextBuffer.module.exports.TextBuffer.save (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1037:19)
    at TextEditor.module.exports.TextEditor.save (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\text-editor.js:630:26)
    at Pane.module.exports.Pane.saveItem (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:545:18)
    at Pane.module.exports.Pane.saveActiveItem (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:528:19)
    at Workspace.module.exports.Workspace.saveActivePaneItem (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\workspace.js:649:35)
    at atom-workspace.commandRegistry.add.core:save (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\register-default-commands.js:173:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:260:29)
    at C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (C:\Users\chris\AppData\Local\atom\app-1.5.3\resources\app.asar\src\window-event-handler.js:3:61)

@rjmunro
Copy link

rjmunro commented Oct 6, 2016

It looks like this was supposed to be fixed by e68e8e9, but it doesn't seem to have worked. I was able to hack the makeValidator function in ~/.atom/packages/json-schema/lib/schema-linter.js to:

var makeValidator = _.memoize(function (schema) {
    var loophole = require("loophole");
    if (_.isEmpty(schema))
        return null;
    return loophole.allowUnsafeNewFunction(function() {
      return validator(schema);
    });
});

which did seem to fix the problem.

@bennypowers
Copy link

I've applied your code, @rjmunro but I still get the EvalError

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

No branches or pull requests

10 participants