-
Notifications
You must be signed in to change notification settings - Fork 1.3k
JS API Error object does not contain backtrace #1783
Comments
Amendment: backtrace seems to show when errors are generated by the compiler, but not when they are generated by the |
I think these changes need to go in LibSass. I believe there might also already be an issue tracking this there. |
@nschonni yeah I figure since a compiler error contains a backtrace, it is probably that Libsass is not generating the backtrace for |
@lunelson Any updates on this? |
No, this is still broken. Here is a repo to isolate and demonstrate the problem: https://github.com/lunelson/node-sass-error-trace Clone and run WARNING: this is a warning
Backtrace:
src/_warn-fn.scss:2, in function `warn`
src/_partial.scss:10, in mixin `warn-error-test`
src/test.scss:7
Error: this is an error
on line 2 of src/_error-fn.scss
>> @error '#{$str}';
--^ |
|
This no longer happens as of node-sass 4.13.0 with libsass 3.5.5:
|
The
Error
object described here in the README does not contain backtrace information in any of its properties, it only holds a reference to the file where the@error
was finally generated. There were other threads about this, both here and at the libsass repo; but maybe that concerned console output and not the JS API...anyway I can't be sure if libsass is not generating the backtrace, or if node-sass is not passing it on in theError
?#1345
sass/libsass#41
Notably, the
@warn
directive does produce backtrace info to the console, so the@error
directive should be capable of passing it as well 😁The text was updated successfully, but these errors were encountered: