AtomLinter/linter-coffeelint

Invalid Linter: grammarScopes is not an Array. (see console for more info)

mnquintana opened this issue · 12 comments

Just updated from 0.3.0 to 1.0.0, and this error got thrown:

Error: grammarScopes is not an Array. (see console for more info)
  at Object.module.exports.validateLinter (/Users/machistequintana/.atom/packages/linter/lib/helpers.coffee:19:17)
  at Linter.addLinter (/Users/machistequintana/.atom/packages/linter/lib/linter-plus.coffee:46:18)
  at Object.module.exports.consumeLinter (/Users/machistequintana/.atom/packages/linter/lib/main.coffee:62:17)
  at Provider.module.exports.Provider.provide (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/service-hub/lib/provider.js:30:34)
  at ServiceHub.module.exports.ServiceHub.provide (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/service-hub/lib/service-hub.js:29:18)
  at Package.module.exports.Package.activateServices (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:372:65)
  at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:243:16)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:221:30
  at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:165:15)
  at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:213:14)
  at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:452:21)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:306:60
  at exit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:53:16)
  at triggerExitCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:213:47)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:227:18
  at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:98:18)
  at emitOne (events.js:82:20)
  at Socket.emit (events.js:166:7)
  at Pipe.close (net.js:464:12)
  1. Open Settings View
  2. Go to the Updates panel
  3. Click the Update button for linter-coffeelint
  4. When it finishes installing, this error is thrown

If it helps, I had a .coffee file open in another tab when I updated the linter, so maybe that's what was going on here?

I can't reproduce this issue. grammarScopes definitely is an array, so this shouldn't be thrown.

I got this on updating as well, the console said that grammarScope was undefined at helpers.coffee:32.

It looks like the linter simply has issues with updating as after restarting Atom it works perfectly fine.

More legacy in memory issues?

I'm pretty sure this is only going to happen as you upgrade and reloading or restarting atom will fix it, but I'm still interested in seeing what the console says. it should log what it claims grammarScope was if not an array.

in steelbrain/linter#686 I've changed the validation code so that it shows what is passed as grammarScopes in the error, rather than the console.

The reason I put it in the console was so you could always get real information and never [object Object]

Oh. I'll fix that.

FWIW, grammarScopes was undefined in the console log.

Thanks. That leaves me even more confused 😕 I wonder if every linter is going to have this problem as they remove the pre-1.0 linter code

Most likely.

Just upgraded to 1.0 and got the same error.

and yeah @AsaAyers reloading fixed it