KunihikoKido / atom-elasticsearch-client

elasticsearch-client
https://atom.io/packages/elasticsearch-client
MIT License
31 stars 3 forks source link

Fails basic query #4

Open jervispinto opened 9 years ago

jervispinto commented 9 years ago
{
  "query": {
    "match_all": {}
  }
}

Ctrl + Alt + S produces this stack trace

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'".
Hide Stack Trace
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 /opt/homebrew-cask/Caskroom/atom/1.0.2/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:10809:16
    at /opt/homebrew-cask/Caskroom/atom/1.0.2/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:11082:21
    at /opt/homebrew-cask/Caskroom/atom/1.0.2/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:8152:31
    at Object.template (/opt/homebrew-cask/Caskroom/atom/1.0.2/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:10808:20)
    at resolveUrl (/Users/jervispinto/.atom/packages/elasticsearch-client/node_modules/elasticsearch/src/lib/client_action.js:233:22)
    at exec (/Users/jervispinto/.atom/packages/elasticsearch-client/node_modules/elasticsearch/src/lib/client_action.js:282:26)
    at Object.action (/Users/jervispinto/.atom/packages/elasticsearch-client/node_modules/elasticsearch/src/lib/client_action.js:60:16)
    at SearchRequestBody.module.exports.SearchRequestBody.run (/Users/jervispinto/.atom/packages/elasticsearch-client/lib/commands/search-request-body.coffee:15:13)
    at SearchRequestBody.BaseCommand.initialize (/Users/jervispinto/.atom/packages/elasticsearch-client/lib/commands/base.coffee:32:7)
    at SearchRequestBody.BaseCommand (/Users/jervispinto/.atom/packages/elasticsearch-client/lib/commands/base.coffee:28:6)
    at new SearchRequestBody (/Users/jervispinto/.atom/packages/elasticsearch-client/lib/commands/search-request-body.coffee:6:3)
    at /Users/jervispinto/.atom/packages/elasticsearch-client/lib/elasticsearch-client.coffee:382:66
    at atom-workspace.<anonymous> (/Users/jervispinto/.atom/packages/elasticsearch-client/lib/elasticsearch-client.coffee:242:7)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/1.0.2/Atom.app/Contents/Resources/app.asar/src/command-registry.js:240:29)
    at /opt/homebrew-cask/Caskroom/atom/1.0.2/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
KunihikoKido commented 9 years ago

You need to load the latest code for our package by reloading the window. Run the command window:reload from the command palette or by pressing ctrl-alt-cmd-l.

aaronsharper commented 9 years ago

I am getting a similar error as well. I have tried reloading the window as well as downloading a fresh copy with no luck.

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 /Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:10809:16
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:11082:21
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:8152:31
  at Object.template (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/index.js:10808:20)
  at resolveUrl (/Users/d3p018/.atom/packages/elasticsearch-client/node_modules/elasticsearch/src/lib/client_action.js:233:22)
  at exec (/Users/d3p018/.atom/packages/elasticsearch-client/node_modules/elasticsearch/src/lib/client_action.js:282:26)
  at Object.action (/Users/d3p018/.atom/packages/elasticsearch-client/node_modules/elasticsearch/src/lib/client_action.js:60:16)
  at SearchRequestBody.module.exports.SearchRequestBody.run (/Users/d3p018/.atom/packages/elasticsearch-client/lib/commands/search-request-body.coffee:15:13)
  at SearchRequestBody.BaseCommand.initialize (/Users/d3p018/.atom/packages/elasticsearch-client/lib/commands/base.coffee:32:7)
  at SearchRequestBody.BaseCommand (/Users/d3p018/.atom/packages/elasticsearch-client/lib/commands/base.coffee:28:6)
  at new SearchRequestBody (/Users/d3p018/.atom/packages/elasticsearch-client/lib/commands/search-request-body.coffee:6:3)
  at /Users/d3p018/.atom/packages/elasticsearch-client/lib/elasticsearch-client.coffee:382:66
  at atom-workspace.<anonymous> (/Users/d3p018/.atom/packages/elasticsearch-client/lib/elasticsearch-client.coffee:242:7)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:159:32)
  at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/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 (/Applications/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 (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)
agencia commented 8 years ago

same here

danpolanco commented 8 years ago

Appreciate this plugin very much :)

Any update? Perhaps changing https://github.com/KunihikoKido/atom-elasticsearch-client/blob/master/lib/config.coffee#L2 to match:

screen shot 2016-02-14 at 3 25 15 pm https://discuss.atom.io/t/getting-unsafe-eval-with-loophole/16580/2

n1k0 commented 7 years ago

I'm getting this error as well. Any way to have this package updated?