pusher / atom-pair

An Atom package that allows for epic pair programming
MIT License
1.45k stars 28 forks source link

Failed to activate: Unexpected token ) #126

Closed franzbertani closed 6 years ago

franzbertani commented 7 years ago

On Atom clean install

Atom: 1.19.0 x64 Electron: 1.6.9 OS: Mac OS X 10.12.6 Thrown From: atom-pair package 2.0.12

Stack Trace

Failed to activate the atom-pair 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 (Applications/Atom.app/Contents/Resources/app/static/index.js:47:45)
    at require (/Applications/Atom.app/Contents/Resources/app/src/native-compile-cache.js:66:33)
    at /packages/atom-pair/lib/modules/session.coffee:1:1)
    at /packages/atom-pair/lib/modules/session.coffee:1:1)
    at /packages/atom-pair/lib/modules/session.coffee:1:1)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/src/native-compile-cache.js:106:36)
    at Object.value [as .coffee] (/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 (Applications/Atom.app/Contents/Resources/app/static/index.js:47:45)
    at require (/Applications/Atom.app/Contents/Resources/app/src/native-compile-cache.js:66:33)
    at Object.activate (/packages/atom-pair/lib/atom_pair.coffee:42:15)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:253:25)
    at /Applications/Atom.app/Contents/Resources/app/src/package.js:225: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:218:32
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:215:40)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:645:40)
    at /Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/package-manager.js:535:35
    at exit (/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/package-manager.js:128:22)
    at triggerExitCallback (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:338:17)
    at ChildProcess.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:368:17)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

Commands

  4x -0:45.2.0 key-binding-resolver:toggle (input.hidden-input)
     -0:38.8.0 settings-view:open (input.hidden-input)
     -0:30.6.0 core:close (div.panels-item)
     -0:29.6.0 settings-view:open (input.hidden-input)
     -0:24 core:confirm (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.4 
atom-pair 2.0.12 
hey-pane 1.0.0 
fppgodinho commented 7 years ago

I'm having this same issue

benhunsaker commented 7 years ago

Same here

oumad commented 7 years ago

For those who have this issue with atom v1.19.0, I fixed it by going back to 1.18.0

RyoYokoyama commented 7 years ago

Same issue, too with Atom v.1.19.3

kn100 commented 7 years ago

Investigating this, it seems the issue started on the release of 1.19.0beta0 - that's the earliest release I can find that suffers from it. I will investigate further. For now, it still works fine with 1.18.0.

Thomasims commented 7 years ago

I found a temporary fix for this,

The file lib/pusher/pusher.js is not parseable alone. Line 219 has }).call(this); which is not closing any (function() { https://github.com/pusher/atom-pair/blob/0607650e7a6b0965965ed144bcbfb92fbe5efae2/lib/pusher/pusher.js#L219 likewise, the line 3911 has a (function() { which is never closed. https://github.com/pusher/atom-pair/blob/0607650e7a6b0965965ed144bcbfb92fbe5efae2/lib/pusher/pusher.js#L3911

to 'fix' it comment out the line 219 and add this at the end of the file:

window.Pusher = Pusher;
}).call(this);

The window.Pusher line is there to avoid another error later on.

My guess as to why this is happening is because this version of the Pusher js lib relied on the way the file was processed. I assume the previous versions wrapped the code in a function before evaluating it, which may be the reason the file was made unparseable alone in the first place.

kn100 commented 6 years ago

Resolved, Atom-pair should now work for the latest version of Atom.

booch commented 6 years ago

@kn100, would it be possible to add that to the release notes? I followed the link to https://atom.io/packages/atom-pair, then hit "Versions" to go to https://github.com/pusher/atom-pair/releases to see if this was resolved yet.

kn100 commented 6 years ago

Good thought, I missed this. Thanks!