Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Notification expecting string but object is passed #511

Closed
pvamshi opened this issue Mar 27, 2016 · 9 comments
Closed

Notification expecting string but object is passed #511

pvamshi opened this issue Mar 27, 2016 · 9 comments

Comments

@pvamshi
Copy link
Contributor

pvamshi commented Mar 27, 2016

While fixing errors with Fix error option , for some reason the fix failed . But notification received is an object which we are passing as is to atom notification . Which is expecting a string , so it does not show the error message in notification.
I get the following error in console

Uncaught (in promise) Error: Notification must be created with string message: Error: Linter-ESLint: Fix Attempt Completed, Linting Errors Remain(…)

After debugging I realized the response object is of the form

{
   "message" : "Linter-ESLint: Fix Attempt Completed, Linting Errors Remain"
}

The code in linter-eslint is like this :

        this.worker.request('job', {
          type: 'fix',
          config: atom.config.get('linter-eslint'),
          filePath
        }).then((response) =>
          atom.notifications.addSuccess(response)
        ).catch((response) =>
          atom.notifications.addWarning(response)
        )

I am not sure if this something that should be fixed here or else where .

@Arcanemagus
Copy link
Member

Looks like it should just be changed to response.message, right?

@pvamshi
Copy link
Contributor Author

pvamshi commented Mar 30, 2016

Looks like. But I am not sure if it's in that form all the time . Success message is working fine. Need more inspection .

@v3ss0n
Copy link

v3ss0n commented Oct 22, 2016

this making linter broke for my atom, no fix?

@IanVS
Copy link
Member

IanVS commented Oct 22, 2016

@v3ss0n, a PR would be welcome. Good opportunity towards a hacktoberfest shirt. 😉

@zaroth
Copy link

zaroth commented Jan 12, 2018

It seems I'm still getting a similar error in 2018, on a fresh atom(1.23.3)+eslint(4.15.0)+linter(2.2.0)+linter-eslint(8.4.0) install:
linter-eslint-bug
Has the bug been reintroduced or is the fix from the PR not released yet?

@Arcanemagus
Copy link
Member

@zaroth The issue originally filed here was fixed in v8.1.0. Can you file a new issue with that GIF as well as any information you can share about the repository in question? (A .zip, gist, or example repository showing this would be amazing.)

@zaroth
Copy link

zaroth commented Jan 17, 2018

I wish I could help more, but I can't specify more than knowing that the bugged error message was about me not having correct configuration in the beginning. After some pain and tutorials I managed to set up eslint correctly and the failed notification went away - and all other ones going forward were shown correctly and I can't reproduce the error any more.

I don't really remember what I did that my setup started working - I remember installing eslint locally instead of globally, installing eslint-cli globally and fiddling around with the .eslintrc.js file to try and make it work. As for the project folder, it was a freshly made from vue-cli: vue init webpack-simple.

@nauderuan
Copy link

I had the same prob with the right click ESLink Fix, seems the below fixed it for me
image
You might need to disable and enable the eslint plugin for it to take affect

@LukeKugelmanTW
Copy link

I had the same problem and thanks to @nauderuan comment worked out that my .eslintrc file had a typo and so linter-eslint wasn't finding the config file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants