Skip to content
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

Problems with errors in imported LESS files #463

Closed
matthew-dean opened this issue Nov 15, 2011 · 9 comments
Closed

Problems with errors in imported LESS files #463

matthew-dean opened this issue Nov 15, 2011 · 9 comments

Comments

@matthew-dean
Copy link
Member

I'm noticing two major issues with imported sheets and returning errors. They are:

  1. Errors are not raised when calling the parser directly in code if the error occurs for an imported sheet. That is, it will raise/return an error for the first sheet, but subsequent errors in imported sheets are not raised. I was able to get around this by altering the code to raise the error in the form of an event, but it would be nice if it would bubble up with an error to the original call. Right now, I think it's just generating some markup, which is strange and not what I need programmatically.
  2. In my UI, I was hope to give feedback as to what file caused the error and where. However, the line number returned is not correct. The line counting seems to not be reset, meaning I can't say "Error in Filename: X in Line: Y", because Line Y is not where the error actually is in File X.
@matthew-dean
Copy link
Member Author

Gentle reminder that this issue is still outstanding.

@lukeapage
Copy link
Member

duplicate of #455? fixed by #456 maybe

@ghost ghost assigned matthew-dean Aug 12, 2012
@lukeapage
Copy link
Member

@MatthewDL could you take a look and decide whether this is fixed and whether it is a bug/feature request? I'm not sure about (1).. I think (2) is fixed.

@matthew-dean
Copy link
Member Author

These are two bugs.

The first is a duplicate of issue #723.
The second I haven't seen listed elsewhere. The line numbering algorithm is wrong, unless that's been fixed at some point, but neither of those issues seems to address it. For instance, it might say, "Error in file.less in line 230", with the filename being correct, but the line of the error actually 110.

@lukeapage
Copy link
Member

Could you retest or provide a testcase? I haven't seen anything like this
whilst I was looking at errors.

@lukeapage
Copy link
Member

@MatthewDL could you retry and provide a test case.. I think these are fixed, so I think this can be closed. If you have a broken example, it should be easy to fix.

@matthew-dean
Copy link
Member Author

Ok, will look at this again when I have a chance.

@daemonl
Copy link
Contributor

daemonl commented Nov 30, 2012

Line 102 of parser.js - On finish uses the error from the current import, should use the saved 'that.error' from all imports.

if (that.queue.length === 0) { finish(that.error) }       // Call `finish` if we're done importing

Can create a pull request.

lukeapage pushed a commit that referenced this issue Dec 16, 2012
parser.imports stored any errors in .error, but only returned an error to the callback on that last import in the queue.

This commit makes it return the stored error (that.error).

issue #463
@lukeapage
Copy link
Member

pull request committed, this should be fixed now.

stefanklug pushed a commit to stefanklug/carto that referenced this issue Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants