shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.45k stars 173 forks source link

At 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'". #1371

Open tino-michael opened 5 years ago

tino-michael commented 5 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.36.0 x64 Electron: 4.1.4 OS: linux 5.0.7-arch1-1-ARCH Thrown From: markdown-preview-enhanced package 0.15.10

Stack Trace

Failed to activate the markdown-preview-enhanced package

At 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'".

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 (<anonymous>)
    at field (/packages/markdown-preview-enhanced/node_modules/vega-util/build/vega-util.js:110:7)
    at /packages/markdown-preview-enhanced/node_modules/vega-util/build/vega-util.js:118:12
    at /packages/markdown-preview-enhanced/node_modules/vega-util/build/vega-util.js:2:66
    at /packages/markdown-preview-enhanced/node_modules/vega-util/build/vega-util.js:5:2)
    at /packages/markdown-preview-enhanced/node_modules/vega-util/build/vega-util.js:814:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/markdown-preview-enhanced/node_modules/vega-loader/build/vega-loader.node.js:5:16)
    at /packages/markdown-preview-enhanced/node_modules/vega-loader/build/vega-loader.node.js:416:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/vega.js:12:23)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/vega.js:62:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/process-graphs.js:19:17)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/process-graphs.js:278:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/markdown-convert.js:18:26)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/markdown-convert.js:237:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/markdown-engine.js:20:28)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/markdown-engine.js:2124:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/mume.js:22:25)
    at /packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/out/src/mume.js:102:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/markdown-preview-enhanced/out/src/extension.js:11:14)
    at /packages/markdown-preview-enhanced/out/src/extension.js:566:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at Package.requireMainModule (/usr/lib/atom/src/package.js:776:27)
    at Package.activateNow (/usr/lib/atom/src/package.js:214:34)
    at activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (/usr/lib/atom/src/package.js:895:75)
    at Function.simpleDispatch (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:64:14)
    at Emitter.emit (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:257:28)
    at PackageManager.triggerDeferredActivationHooks (/usr/lib/atom/src/package-manager.js:724:34)
    at Promise.all.then (/usr/lib/atom/src/package-manager.js:657:12)

Commands

Non-Core Packages

atom-ide-ui 0.13.0 
autocomplete-awk 0.1.2 
autocomplete-clang 0.11.5 
autocomplete-date 0.4.0 
autocomplete-latex 0.9.0 
autocomplete-python-jedi 1.10.3-0 
block-selection-mode 0.3.0 
busy-signal 2.0.1 
color-picker 2.3.0 
darkpython-syntax 0.5.0 
figlet 0.5.4 
file-icon-supplement 0.8.3 
file-watcher 2.0.0 
git-time-machine 2.1.0 
highlight-selected 0.16.0 
ide-python 1.4.1 
intentions 1.1.5 
language-dotfiles 1.1.0 
language-latex 1.2.0 
latex-autocomplete 1.1.1 
line-breaker 0.4.1 
linter 2.3.0 
linter-clang 4.1.2 
linter-flake8 2.4.0 
linter-ui-default 1.7.1 
markdown-preview-enhanced 0.15.10 
minimap 4.29.9 
minimap-bookmarks 0.4.2 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
northem-dark-atom-syntax 2.1.0 
northem-dark-atom-ui 2.1.0 
pdf-view 0.71.0 
pigments 0.40.2 
project-manager 3.3.7 
python-indent 1.1.7 
python-tools 0.6.9 
semanticolor 3.6.0 
seti-syntax 1.2.0 
seti-ui 1.11.0 
simple-drag-drop-text 0.4.0 
slickedit-select 1.6.2 
stash-tabs 0.1.0 
switch-header-source 0.33.0 
todo-show 2.3.2 
tree-view-git-status 1.5.2 
scarwire commented 5 years ago

Not sure what caused this problem, but it has something to do with the slightly modified version of Atom (or Electron?) in the archlinux repository. I managed to fix the problem by replacing the regular package from the community repo with the atom-editor-bin package from the AUR, which aims to be as close as possible to the upstream version.

You might want to report the bug directly to the person who maintains the archlinux package.