david-driscoll / atom-yeoman

A yeoman ui for atom.io
https://github.com/david-driscoll/atom-yeoman
MIT License
26 stars 5 forks source link

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an al... #39

Closed pavelm closed 9 years ago

pavelm commented 9 years ago
  1. Install ionide/fsharp packages
  2. Run F#: New Project command

Atom Version: 1.0.16 System: Mac OS X 10.10.5 Thrown From: atom-yeoman package, v0.3.14

Stack Trace

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

At /Users/pavel/.atom/packages/atom-yeoman/node_modules/yeoman-generator/node_modules/download/node_modules/got/node_modules/create-error-class/index.js: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 createErrorClass (/Users/pavel/.atom/packages/atom-yeoman/node_modules/yeoman-generator/node_modules/download/node_modules/got/node_modules/create-error-class/index.js:18:49)
  at Object.<anonymous> (/Users/pavel/.atom/packages/atom-yeoman/node_modules/yeoman-generator/node_modules/download/node_modules/got/index.js:310:20)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/Users/pavel/.atom/packages/atom-yeoman/node_modules/yeoman-generator/node_modules/download/index.js:9:11)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/Users/pavel/.atom/packages/atom-yeoman/node_modules/yeoman-generator/lib/actions/fetch.js:3:16)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/Users/pavel/.atom/packages/atom-yeoman/node_modules/yeoman-generator/lib/base.js:191:26)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (/Users/pavel/.atom/packages/atom-yeoman/node_modules/yeoman-generator/index.js:41:15)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at /Users/pavel/.atom/packages/atom-yeoman/lib/generator.js:52:9
  at Object.exports.allowUnsafeNewFunction (/Users/pavel/.atom/packages/atom-yeoman/node_modules/loophole/lib/loophole.js:25:14)
  at /Users/pavel/.atom/packages/atom-yeoman/lib/generator.js:50:14
  at Object.<anonymous> (/Users/pavel/.atom/packages/atom-yeoman/lib/generator.js:91:3)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at GeneratorService.run (/Users/pavel/.atom/packages/atom-yeoman/lib/generator-service.js:15:25)
  at atom-workspace.<anonymous> (/Users/pavel/.atom/packages/ionide-yeoman/lib/yeoman.js:12:18)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:159:32)
  at CommandPaletteView.module.exports.SelectListView.confirmSelection (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
  at space-pen-div.atom.commands.add.core:confirm (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/opt/homebrew-cask/Caskroom/atom/1.0.11/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)

Commands

     -0:04.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:01.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:01.5.0 F#:New-project (atom-text-editor.editor)

Config

{
  "core": {}
}

Installed Packages

# User
atom-yeoman, v0.3.14
ionide-fake, v1.2.0
ionide-fsharp, v1.2.1
ionide-fsi, v1.0.6
ionide-installer, v1.2.1
ionide-paket, v2.0.9
ionide-yeoman, v1.0.1
linter, v1.6.0

# Dev
No dev packages
david-driscoll commented 9 years ago

I hate CSP... I hate CSP... @Krzysztof-Cieslak any ideas if this is something new in the F# generator? the latest update I didn't push through any new references to lodash (which is what generally causes this CSP problem with yeoman). I'll see if I can investigate tonight though.

Krzysztof-Cieslak commented 9 years ago

Well, we haven't changed anything lately - last update to F# generator was 29 days ago. So I don't think it's issue there.

david-driscoll commented 9 years ago

fair enough... I'll see if I can fix it tonight...

Did I mention I hate CSP? :-1:

On Thu, Sep 24, 2015 at 12:52 PM, Krzysztof Cieślak < notifications@github.com> wrote:

Well, we haven't changed anything lately - last update to F# generator was 29 days ago. So I don't think it's issue there.

— Reply to this email directly or view it on GitHub https://github.com/david-driscoll/atom-yeoman/issues/39#issuecomment-142986346 .

vilinski commented 9 years ago

I have also no luck. Seems to be a common issue https://github.com/AtomLinter/linter-eslint/commit/b5f351a4517317cb5aea483a450143befe67cc52

StachuDotNet commented 9 years ago

Same issue today; blocking me currently. Can I do anything to help?

david-driscoll commented 9 years ago

The last time I fixed it, it was a deep deep dependency on lodash.template, which uses eval under the covers. I'm going to look into it today and see if I can figure something out (I installed ionide the other day).

david-driscoll commented 9 years ago

If someone can try #40 locally as a sanity check, that'd be great. Otherwise for F# projects they went from not working, to working with the changes.

vilinski commented 9 years ago

with atome yeoman 0.3.15 today another error:

Unhandled promise rejection Promise with error: Error: ENOENT: no such file or directory, stat 'C:\Users\asvili\AppData\Local\atom\app-1.0.19\atom:\about'
  at Error (native)
  at fs.statSync (fs.js:854:18)
  at Object.fs.statSync (ATOM_SHELL_ASAR.js:225:16)
  at Function.Generator.getTreeViewDirectory (C:\Users\asvili\.atom\packages\atom-yeoman\lib\generator.js:166:24)
  at Generator.getPath (C:\Users\asvili\.atom\packages\atom-yeoman\lib\generator.js:119:51)
  at tryCatcher (C:\Users\asvili\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\babel-core\node_modules\bluebird\js\main\util.js:26:23)
  at Promise.module.exports.Promise._resolveFromResolver (C:\Users\asvili\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\babel-core\node_modules\bluebird\js\main\promise.js:480:31)
  at new Promise (C:\Users\asvili\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\babel-core\node_modules\bluebird\js\main\promise.js:70:37)
  at Function.Generator.getPath (C:\Users\asvili\.atom\packages\atom-yeoman\lib\generator.js:115:16)
  at Generator.run (C:\Users\asvili\.atom\packages\atom-yeoman\lib\generator.js:220:30)
  at C:\Users\asvili\.atom\packages\atom-yeoman\lib\generator-service.js:17:87
  at C:\Users\asvili\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\babel-core\node_modules\lodash\index.js:1773:43