file-icons / atom

Atom file-specific icons for improved visual grepping.
MIT License
1.32k stars 250 forks source link

Unexpected token ) - Failed to activate the file-icons package #753

Closed Rockster160 closed 6 years ago

Rockster160 commented 6 years ago

Updated file-icons to the latest version this morning and got the error. file-icons was the only package updated at the time.

Happy to answer any questions / supply any more information that could help fix this. It looks like the "bug" is the icons falling back to:

messages image 3061620444

Atom: 1.23.3 x64 Electron: 1.6.15 OS: Mac OS X 10.13.6 Thrown From: file-icons package 2.1.23

Stack Trace

Failed to activate the file-icons package

At Unexpected token )

SyntaxError: Unexpected token )
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/src/native-compile-cache.js:94:52)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/src/compile-cache.js:239:29)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/Applications/Atom.app/Contents/Resources/app/src/native-compile-cache.js:66:33)
    at /packages/file-icons/lib/main.js:7:25)
    at Object.activate (/packages/file-icons/lib/main.js:15:7)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:255:25)
    at /Applications/Atom.app/Contents/Resources/app/src/package.js:227:38
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:99:21)
    at /Applications/Atom.app/Contents/Resources/app/src/package.js:220:32
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:217:40)
    at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:695:42)
    at config.transactAsync (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:670:36)
    at Config.module.exports.Config.transactAsync (/Applications/Atom.app/Contents/Resources/app/src/config.js:367:24)
    at PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:668:23)
    at PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:647:50)
    at /Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:865:36

Non-Core Packages

Atom-Syntax-highlighting-for-Sass 0.5.0 
autocomplete-ruby 0.2.8 
change-case 0.6.5 
clipboard-plus 0.5.1 
color-picker 2.3.0 
css-declaration-sorter 1.2.2 
file-icons 2.1.23 
git-diff-details 1.4.0 
minimap 4.29.8 
minimap-git-diff 4.3.1 
multi-cursor-aligner 0.0.0 
multi-cursor-increment 0.1.1 
multi-select-switch 0.0.0 
multiclip 0.0.0 
pigments 0.40.2 
rails-latest-migration 1.1.6 
rails-transporter 1.7.1 
rainbow-delimiters 2.1.2 
svg-preview 0.12.1 
tablr 1.8.3 
toggle-quotes 1.1.1 
Alhadis commented 6 years ago

Atom: 1.23.3 x64

You're running a pretty outdated version of Atom. Does upgrading not help?

You shouldn't be getting syntax errors unless the extracted package files were corrupt. Could you run this command and tell me what it outputs?

$ shopt -s globstar;
$ shasum ~/.atom/packages/file-icons/lib/{*.js,**/*.js}
Rockster160 commented 6 years ago

Ah. Didn't realize Atom was out of date. Computer was having issues with auto-update, it seems. Reinstalled Atom and all packages and things are looking good now. Thanks for the prompt reply. πŸ‘

Alhadis commented 6 years ago

No problem! I should either bump the minimum required Atom version, or investigate exactly what syntax it is that it can't handle... πŸ€”

zedin27 commented 6 years ago

Yeah, I'm using 1.23.3 in OSX 64x, and I'm encountering the same issue. I prefer if there is a minimum version to run it properly :D

Alhadis commented 6 years ago

Well, setting a minimum version won't do any good now... 😞 If I bumped the version and cut another release, users running v1.23.3 will still be downloading the last (incompatible release).

This issue's been opened by 30 unique visitors, so plenty more people will be complaining, I suspect. Only responsible thing to do is cut a patch release to correct it.

FYI, it's the trailing commas it can't handle. Atom v1.23.3 embeds Node 7.4.0, which doesn't support trailing comma syntax introduced in Node 8+. Forgot how recent that addition was. πŸ˜•

Alhadis commented 6 years ago

Okay, fixed in v2.1.24. That'll be the last file-icons release to support this particular version. πŸ˜‰ Anybody still running an outdated Atom version should, well, upgrade manually.

npm nah