-
Notifications
You must be signed in to change notification settings - Fork 141
"Error: Cannot mark location in editor for ..." popping up in Atom #700
Comments
+1. Also having this issue since the update. |
For anyone else having this issue, here is a temporary solve to revert to 7.2.4 which doesn't have this issue. (Tried 7.3.0 which still had this issue)
This should get you up and running again. |
@yourfavorite Worked for me too. Thanks! Hopefully this gets resolved soon. |
Thanks for the reports. These errors happen when ESLint reports an invalid rule/column location of an error. It would be very helpful if you could share the snippet of code that caused the error, so that we can reproduce and file an issue at ESLint. Or, if you can create a reproducible case, feel free to file the issue at ESLint yourself. Downgrading to Thanks for your help! |
@IanVS Hey thanks for getting back to us. I don't think any specific snippet of code caused the errors because it was occurring in every file. I kinda suspect it might be due to my Here's the
|
@chesterhow, are you sure you get the same error on every file? I assume the |
This is the error I receive every time I have more than 2 empty lines. In my
If I change this to From what I've tested, this is the only rule that is triggering errors. |
For those of you getting errors on |
This bug is caused by the "fix on save" feature and a race condition in the linter, @IanVS. The linter tries to place the markers for the errors and warnings, but the fixer is currently swapping out the contents of the editor with the fixed version and thus the location the linter is trying to mark is no longer present. |
@JonathanWolfe are you saying you're getting the error when you save the file? it's entirely possible that a case like that does cause the error in some situations, but many people are seeing the error even when they are not saving. |
@IanVS That is the only time I get the errors. I did see the error more often before updating Eslint, but now that's the only time. |
@IanVS Yea sorry a bit of miscommunication here. The errors I was referring to was the I've also updated ESLint to |
@chesterhow it would be very helpful if you could provide an example both the error message as well as a line of code that the error references. @JonathanWolfe Thanks, we'll have to look into this. Actually, could you make a separate issue for the error when autofixing, so it doesn't get lost in this thread which I expect will get pretty unwieldy. |
@IanVS Well this is awfully embarrassing.. To be really honest here, I can't seem to find a fixed series of steps which will reproduce the error. Each time I try to get it to appear nothing seems to happen. But after trying for a couple of minutes it would pop up again. I have an example here but I don't really know the exact steps because it just happened while I was typing Exact Error Message
Note: column (24) is where my cursor is in the code screen shot. I'll try to find a better example tomorrow, but in the meantime if anyone else knows how to replicate the error please do help us out 🆘 |
@IanVS This happens while I'm editing the file without triggering a save. I've seen all of the screenshot errors so far pop up in my workflow. |
Let's try to clean things up a bit here, as this thread is becoming a mess. First of all, these are not all the same bug! The string inside the first As it is the most common mentioned in this thread, and part of the first report, let's focus this issue on the When reporting a new issue please share your ESLint configuration, and a file that can reproduce this. We can help trace down what the minimal case is and report it over on ESLint so it can get fixed. If you can't find a file state that shows the error, a recording (GIF, YouTube, ...) of your Atom window when this happens for you might help to track it down. For anyone seeing the |
@Arcanemagus I think the common thread here (and the heart of the bug) is the "Cannot mark location in editor for (...)" aspect. And it seems to be affecting specific rules. The marking works fine for most rules in my case. There's just a handful of rules that this plugin seems to be having trouble figuring out where to mark it in Atom. |
@webbower We have found (and fixed) one rule in ESLint which was reporting an invalid location (a column number which did not exist in the file). Our working hypothesis is that there are more such rules, and we are hoping that users can help us find them so that we can fix them as well. |
Happens to me as well after update: linter-eslint 7.3.0 -> 7.3.1 Rule: no-multiple-blank-lines
|
Problem is still exist: Atom 1.10.2
|
Okay, I've managed to find a working example to replicate the error for the
const testString1 = 'hello world'
const testString1 = 'hello world'
const testString2 = 'goodbye world'
const testString1 = 'hello world'
const testString2 = 'go' Screenshots for reference |
We've confirmed that there can be a race condition between when a lint is triggered, and when ESLint returns the results, where the text has changed in the meantime making the ranges returned by ESLint invalid. We're thinking of a good solution for this, however that doesn't mean that when you have that message you are always hitting this race condition. If the message shows up every time you save the file (and make no changes between saving and the message showing up), then either comment here with the file and configuration if the first part of the error is |
v7.3.2 is released with a fix in place to hopefully stop the race condition errors. If you are still seeing errors please report them with the relevant ESLint config, your version of ESLint being used, and code to reproduce it. Thanks! |
Did not fix for me: Error:
eslint version: 2.7.0 eslint config (
|
Same as @mliq, with the same rule, but I tried a minimal example with eslint 3.5.0 and it seems to work fine. I'm using eslint 3.1.1 on my real project and I get the error there, so I assume it's an issue with the old version of eslint. |
@mliq and @julioolvr as has been stated several times in this thread, that rule was fixed in (It's been broken since v1.8.0, only now was it caught!) |
I still have the error. Package.json (relevant) : "devDependencies": {
"babel-cli": "^6.14.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-preset-es2015": "^6.14.0",
"eslint": "^3.5.0",
"eslint-config-airbnb": "^11.1.0",
"eslint-plugin-import": "^1.15.0",
"eslint-plugin-jsx-a11y": "^2.2.2",
"eslint-plugin-react": "^6.2.2",
"nodemon": "^1.10.2"
} .eslintrc: {
"extends": "airbnb",
"rules": {
"no-unused-expressions": 0,
"space-infix-ops": 0,
"default-case": 0,
"no-else-return": 0,
"brace-style": [2, "stroustrup"],
"quote-props": [2, "consistent-as-needed"],
"new-cap": 0,
"react/jsx-filename-extension": 0,
"import/no-extraneous-dependencies": 0
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
} I noticed that this error happens mostly (maybe always) when I hit backspace on a line where there is a lint error (What @chesterhow found). |
@BenoitAverty what error are you getting, and what version of |
linter-eslint is at the last version (7.3.2). For the specific case I was mentionning, I get the error regarding "missing-semicolon" rule. But I'm not sure if it's the only one. |
@BenoitAverty have you tried restarting Atom after upgrading |
Well, not so obvious apparently. I haven't been able to reproduce since restarting atom. I thought I did, but apparently not. Thanks ! |
I should have said "eliminate the easy stuff". I don't know why, but I see a lot of errors that go away when Atom is restarted. Glad it's working now. You had me sweating. :) |
@IanVS and @Arcanemagus thanks for your time answering this thread. I solved my issue thanks to your comments. You might want to mark this issue as solved |
Yep, it seems that we are not seeing additional reports whereas we were being flooded with them before, so I'm going to close this issue. Thanks for your patience everyone! |
This is marked as closed. I have updated everything as per instructions above. Still not resolved.
Upgraded all 3 to latest. Restarted. Any edit of JS file with error I get: NOTE: ! I found the bug. The version of eslint in a specific package was old. Doing a "npm install eslint" in the package in question fixed it. But the global eslint was correct. The package should be checking the eslint version, because otherwise this is a very difficult task to debug, and it will keep happening for people until they manually upgrade eslint in each of their local repositories. |
@scottp this is intended behavior. If you don't have This is off topic for this thread, but one possible improvement we could make is to add a "debug" command which would print out the location of the eslint executable being used to lint the open file. Do you think something like that could have been useful to you? |
Hi @IanVS - Thanks for quick response and quick fix for this. I missed that option in the config and have set it now. However the issue is the bug error message, IMHO - ie. the atom module update now requires a newer version of eslint, but instead of saying that, reports a random error. Best practice would be to say the version is out of date - which can be checked through the library. Then this won't come up as an error for future people, they would then easily know how to fix it. |
@scottp It doesn't require a newer version of |
Fixed as suggested by updating to |
I can confirm that as well. Hopefully, it doesn't come back. |
I've been recently seeing a lot of "Error: Cannot mark location in editor for (no-multiple-empty-lines)" errors in Atom. AtomLinter/linter-eslint#700 claims that this can be fixed by updating eslint to >= 3.5.0. After doing so (and restarting Atom), Atom seems to be able to mark the correct location with the corresponding warning again, and the error is gone.
I've been recently seeing a lot of "Error: Cannot mark location in editor for (no-multiple-empty-lines)" errors in Atom. AtomLinter/linter-eslint#700 claims that this can be fixed by updating eslint to >= 3.5.0. After doing so (and restarting Atom), Atom seems to be able to mark the correct location with the corresponding warning again, and the error is gone.
This issue is closed, but I'm getting this bug today with linter-eslint v8.0.0. |
@callumlocke, can you please open a new issue with the error you are seeing and the output of the debug command? Thanks. |
I'm on linter-eslint 8.0.0 / atom 1.1.2 / El Capitan. Is there an accepted fix? |
@Bosworth99 There are several possible reasons you're getting an error. Please open a new issue with as much information as possible. |
If you are getting this error, it is not due to a problem within If you are seeing an error which includes 'no-empty-lines If you are seeing an error with a different eslint rule name, please open a new issue and provide all of the information requested. I'm going to lock this thread. Feel free to open a new issue if you are getting a new error. |
I'm getting these pop up errors while coding. Can't seem to figure out what's causing the issue. It was working just fine last Friday. Might have been caused by the recent v7.3.1 release?
I've tried reinstalling
linter-eslint
multiple times but still no luck. Any ideas?The text was updated successfully, but these errors were encountered: