ricardofbarros / linter-js-standard

Atom linter plugin for JavaScript, using JavaScript Standard Style
https://atom.io/packages/linter-js-standard
MIT License
99 stars 48 forks source link

Repeated alerts saying "Something went wrong internally" #126

Closed scouten closed 7 years ago

scouten commented 8 years ago
screen shot 2016-07-22 at 13 59 05

I'm seeing a lot of this warning appearing when I edit files in Atom using this plugin. A couple of things:

1) The warning is sufficiently vaguely worded that I at first mistook it for an Atom issue itself. When informed on the Atom.io Slack channel that there was nothing in Atom itself that would issue such a dialog, then I searched the .atom folder and found this:

$ grep -rlIn "this annoying warning" .
./packages/linter-js-standard/lib/linter-js-standard.js
./packages/linter-js-standard/lib/utils/style-settings.js

2) This happens really frequently in some files, never on others. I have no idea what's different. Seems to have started when I installed Atom 1.8.0 (another reason I was inclined to blame Atom at first)

3) Closing and reopening the file never helps.

LMK if there's more detail I can provide.

thtliife commented 8 years ago

@scouten, If you open the dev tools in atom, and then reproduce that warning, do u see any errors in the dev tools console?

scouten commented 8 years ago

I'm away from computer now. Will check it out over the weekend and let you know.

On Fri, Jul 22, 2016 at 19:20 Vito Giarrusso notifications@github.com wrote:

@scouten https://github.com/scouten, If you open the dev tools in atom, and then reproduce that warning, do u see any errors in the dev tools console?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ricardofbarros/linter-js-standard/issues/126#issuecomment-234693715, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJqt41OqFSuFwEsPa3dN1vHSma6A6qKks5qYXqDgaJpZM4JTJHJ .

scouten commented 8 years ago

Nothing obvious. Here's the entire console log from one case where this happened just now:

Window load time: 406ms
/Applications/Atom.app/Contents/Resources/app.asar/src/workspace-element.js:26 ::shadow pseudo-element is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
file:///Applications/Atom.app/Contents/Resources/app.asar/static/font-awesome.min.css Failed to load resource: net::ERR_FILE_NOT_FOUND
/deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
/Users/scouten/.atom/packages/nuclide/pkg/nuclide-task/lib/bootloader.js:58 TASK(8483): Watchman:  Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions
[2016-07-24T03:43:05.600Z] [ERROR] nuclide - Error while talking to watchman:  { [Error: Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions]
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn watchman',
  path: 'watchman',
  spawnargs: [ '--no-pretty', 'get-sockname' ] }
[2016-07-24T03:43:05.613Z] [ERROR] nuclide - Watchman client disconnected, reconnecting a new client!
[2016-07-24T03:43:05.614Z] [INFO] nuclide - getFilesFromWatchman failed, falling back to hg/git/find [Error: The client was ended]
Watchman:  Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions
[2016-07-24T03:43:05.686Z] [ERROR] nuclide - Error while talking to watchman:  { [Error: Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions]
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn watchman',
  path: 'watchman',
  spawnargs: [ '--no-pretty', 'get-sockname' ] }
[2016-07-24T03:43:05.687Z] [ERROR] nuclide - Watchman client disconnected, reconnecting a new client!
[2016-07-24T03:43:05.688Z] [WARN] nuclide - Could not update path sets for /Users/scouten/(redacted). Searches may be stale [Error: The client was ended]
thtliife commented 8 years ago

You're right... Nothing obvious. What version of the linter package is showing up in settings?

scouten commented 8 years ago
screen shot 2016-07-25 at 09 52 20
Arcanemagus commented 8 years ago

It looks like that error is only thrown if settings isn't defined/empty. That seems to only come from the cache, which is set on activation of the package, and when Workspace::onDidChangeActivePaneItem triggers. So somehow the cache is empty when a lint is triggered.

jimmed commented 8 years ago

I've been getting the same problem relentlessly in certain projects.

Opening the devtools shows the following error having been thrown:

Uncaught (in promise) Error: Something went wrong.
    at Object.checkStyleSettings (/Users/jimobrien/.atom/packages/linter-js-standard/lib/utils/style-settings.js:54:13)
    at Object.module.exports.__cacheTextEditor (/Users/jimobrien/.atom/packages/linter-js-standard/lib/init.js:101:21)
    at storeSettings (/Users/jimobrien/.atom/packages/linter-js-standard/lib/init.js:64:14)
    at /Users/jimobrien/.atom/packages/linter-js-standard/lib/init.js:71:7
ricardofbarros commented 7 years ago

Hey @Arcanemagus @jimmed , I've just published a fix on the latest version v3.8.3, care to test? Open if there's some problem. Thanks

jimmed commented 7 years ago

@ricardofbarros I'm afraid I can't test the fix as I'm on a completely different laptop/OS now, working on different projects for a different company, but I appreciate you replying :)

rbudiharso commented 7 years ago

In my case in the dev tool console I got standard is not defined screenshot from 2017-03-21 15-19-32

rbudiharso commented 7 years ago

My Bad, the issue is from linter-js-standard-jsx, disabling it stops the yellow warning pop up.

dcalhoun commented 7 years ago

@ricardofbarros I'm experiencing this error. I believe it started when I changed my StandardJS config to use babel-eslint as the parser. There are no errors in the dev console.

I do not see any settings related to selecting a parser within linter-js-standard's config. Am I doing something incorrect or is this a bug?

xdumaine commented 7 years ago

I'm still getting this, but no errors in the console.

ugiacoman commented 7 years ago

Getting this error as well, any fixes?

hutch120 commented 7 years ago

I fixed it by doing this:

File > Settings > Packages > Search "linter-js-standard" > Click Disable > Click Enable > Restart Atom.io

tumblr_mtud5kx2t71r7fahjo1_250

PuddletownDesign commented 7 years ago

This error is appearing even when editing non-js files for me. Almost any file that I open and again on every save unless I close, reopen and re-save the file.

Hutch your suggestion doesn't fix this for me.

hutch120 commented 7 years ago

@PuddletownDesign

Did you try these things?

I'm guessing that rebuilt the settings data on my system. This must be something to do with settings, right?

if (!settings || !settings.opts || !settings.style) {
  atom.notifications.addWarning('Something went wrong internally.', {
    detail: 'No sweat, just re-open this file and this annoying warning shouldn\'t appear anymore',
    dismissable: true
  })
  return []
}
sekl commented 7 years ago

This started happening for me after updating packages after not having done so in a while.

Check/uncheck each setting checkbox then back to your setting.

This fixed it. :)

geovanisouza92 commented 7 years ago

As said by @hutch120, this part:

if (!settings || !settings.opts || !settings.style) {
  atom.notifications.addWarning('Something went wrong internally.', {
    detail: 'No sweat, just re-open this file and this annoying warning shouldn\'t appear anymore',
    dismissable: true
  })
  return []
}

Specifically this part !settings.style maybe is causing the issue, because, as I can see on my config.cson:

...
  "linter-js-standard":
    checkStyleDevDependencies: true
...

While my settings are like this

selecao_019

settings.style is undefined.


EDIT: Maybe settings.opts too?

xdumaine commented 7 years ago

Can the code for that alert just be removed? I'm going to have to remove this package or fork it.

revelt commented 7 years ago

I agree with @xdumaine, those alerts should have a kill-switch, regular "civilian" users might not be capable to do anything about it anyway, so why annoy them?

revelt commented 7 years ago

Hi all, in the meantime, if you want a solution for this problem, I suggest to uninstall this package and install linter-js-standard-engine instead. Worked for me, I don't get the yellow error popups any more.

Just have the standard installed as a devDependency and it will be tapped OK. I suggest not to use * semver range but update it manually. Last major release (v10) introduced new rules (like import being not at the top) that broke previously valid v9 code.

sonicdoe commented 7 years ago

Does this issue still occur for anyone with v3.9.2 or v3.9.3? I think this might have been fixed with https://github.com/ricardofbarros/linter-js-standard/commit/e51f30bedba39d028431f0ac71bb4f7aed6db5cf.

dcalhoun commented 7 years ago

@sonicdoe I am no longer experiencing this warning. Currently using linter-js-standard@3.9.2.

revelt commented 7 years ago

Me the same, 3.9.2 works fine. #179 is already closed, I think we can close this too. What do you think guys?

hutch120 commented 7 years ago

@sonicdoe @revelt Looking good. Nice work!

Consider removing the dismissable flag for a smother user experience if it happens to occur for a legitimate reason. I think the dismissable flag is only really useful if you want to capture the user close event for some reason. I.e. This:

atom.notifications.addWarning('Something went wrong internally.', {
  detail: 'No sweat, just re-open this file and this annoying warning shouldn\'t appear anymore',
  dismissable: true
})

Becomes this:

atom.notifications.addWarning('Something went wrong internally.', {
  detail: 'No sweat, just re-open this file and this annoying warning shouldn\'t appear anymore'
})
sonicdoe commented 7 years ago

Since v3.9.2 seems to work fine and the warning is no longer even present on master since https://github.com/ricardofbarros/linter-js-standard/commit/e5c73cb33077da64adb6de3d21edc71b82b909c0, I’ll close this issue.