New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent error reporting when globalVars and/or modifyVars are being passed #2573
Comments
The result is actually sort of expected since these inputs expand to the following Less code (with line numbers): 1:
2: Invalid content 2: 1: Invalid content
2: 3: 1:
2: Invalid content
3: 1: Invalid content As you can see every error points to the end of the input (where parser can't finally find anything recognizable). And, yes, What "more consistent" report would you expect? |
As a user I don't have access to the final source (which includes globalVars and modifyVars) which is used for compilation. That means seeing I see that an error may happen in |
That would be an overkill imho. Sorry, I mislabeled by pressing wrong menu. Should be "Needs decision". |
I also like this idea if it doesn't impact on performances too much |
We have the characters added, we should use that to adjust all error
messages surely?
|
Right. Track the start and end of the user content, then adjust the reported error location accordingly. |
@richdougherty Right, ready to make a PR? ;) |
:) I just meant to agree with the simpler option rather than the precompiling option; I didn't want to hassle anyone. In any case, I think @yatskevich is going to work around the issue. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Here is a simple demo of the issue:
index.js
node index.js
gives the following output:Please note that reported line number, column and index change depending on passed
globalVars
andmodifyVars
.The text was updated successfully, but these errors were encountered: