Closed BlackSkorpio closed 7 years ago
BTW,
package
menu)? apm install svgo
alternatively?I can reproduce this too, but only on my Windows installation with Atom 1.9.9. On Linux it works fine.
Issue is still there in v2.2.0, with Win7 Atom 1.9.9
@BlackSkorpio
Where should I run that command, tried in it the atom command palette to no avail
Try in CLI such as Terminal.app
or iTerm.app
?
Thnx, figured it out...
That took me a step further. But instead generates this error when trying to minify a svg
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'".
C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\csso\lib\compressor\index.js:109
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 compress (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\csso\lib\compressor\index.js:109:74)
at minify (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\csso\lib\index.js:80:9)
at Object.minifyBlock (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\csso\lib\index.js:106:12)
at Object.exports.fn (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\plugins\minifyStyles.js:38:42)
at C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo\plugins.js:59:45
at Array.filter (native)
at monkeys (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo\plugins.js:46:39)
at perItem (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo\plugins.js:77:12)
at C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo\plugins.js:18:24
at Array.forEach (native)
at module.exports (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo\plugins.js:14:13)
at C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo.js:63:17
at Object.sax.onend (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo\svg2js.js:156:13)
at emit (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\sax\lib\sax.js:640:35)
at end (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\sax\lib\sax.js:683:5)
at Object.write (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\sax\lib\sax.js:991:14)
at Object.SAXParser.close (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\node_modules\sax\lib\sax.js:157:38)
at module.exports (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo\svg2js.js:169:28)
at SVGO._optimizeOnce (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo.js:56:5)
at SVGO.optimize (C:\Users\user_name\.atom\packages\svgo\node_modules\svgo\lib\svgo.js:49:11)
at minify (C:\Users\user_name\.atom\packages\svgo\index.js:20:21)
at atom-workspace.<anonymous> (C:\Users\user_name\.atom\packages\svgo\index.js:28:60)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\user_name\AppData\Local\atom\app-1.9.9\resources\app.asar\src\command-registry.js:260:29)
at CommandRegistry.handleCommandEvent (C:\Users\user_name\AppData\Local\atom\app-1.9.9\resources\app.asar\src\command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\user_name\AppData\Local\atom\app-1.9.9\resources\app.asar\src\command-registry.js:160:19)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (C:\Users\user_name\AppData\Local\atom\app-1.9.9\resources\app.asar\src\atom-environment.js:1104:28)
at EventEmitter.outerCallback (C:\Users\user_name\AppData\Local\atom\app-1.9.9\resources\app.asar\src\application-delegate.js:329:25)
at emitTwo (events.js:100:13)
at EventEmitter.emit (events.js:185:7)
The error was thrown from the svgo package.
This error was also reported here #4
My current SVGO version is: 2.4.0
So is eval
the issue?
Thats the error it put out right now.
same problem
I don't know what CSP Atom uses and how you can influence this, but the error certainly is there somewhere. The best way to fix this would probably be to get rid of any eval things.
@BlackSkorpio @Nargilia @rugk Still occur?
Now we (I) get another error
Good news it dont deletes all content, it's only refuses to minifying it :/
The full error log shows:
Error: Notification must be created with string message: Error: spawn C:\Users\Bjarne Varöystrand\.atom\packages\svgo\node_modules\.bin\svgo.cmd ENOENT
at Notification.module.exports.Notification.validate (C:\Users\Bjarne Varöystrand\AppData\Local\atom\app-1.12.7\resources\app.asar\src\notification.js:25:15)
at new Notification (C:\Users\Bjarne Varöystrand\AppData\Local\atom\app-1.12.7\resources\app.asar\src\notification.js:20:12)
at NotificationManager.module.exports.NotificationManager.addError (C:\Users\Bjarne Varöystrand\AppData\Local\atom\app-1.12.7\resources\app.asar\src\notification-manager.js:41:35)
at ChildProcess.<anonymous> (C:\Users\Bjarne Varöystrand\.atom\packages\svgo\index.js:36:24)
at emitOne (events.js:96:13)
at ChildProcess.emit (events.js:188:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
@BlackSkorpio It seems to be fixed with newest version 🙏
Running Atom 1.8.0+SVGO 2.12 on Win7
When trying to minify/prettifying a file either via the menu or CTRL+SHIFT+O SVGO deletes all content from the file.