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

Publish sass.js compiled with exceptions #23

Closed
afiestas opened this issue Mar 2, 2015 · 4 comments
Closed

Publish sass.js compiled with exceptions #23

afiestas opened this issue Mar 2, 2015 · 4 comments
Labels

Comments

@afiestas
Copy link

afiestas commented Mar 2, 2015

Hey, could you publish a compiled version of sass.js with exceptions enabled?

Thanks!

@rodneyrehm
Copy link
Member

I'm not sure what you want me to do here. The Makefile patch already includes -s DISABLE_EXCEPTION_CATCHING=0.

@afiestas
Copy link
Author

afiestas commented Mar 2, 2015

What I meant is, the bower artifact contains a libsass compiled without exceptions: https://github.com/medialize/sass.js/blob/master/dist/sass.js

With that copy (that is also deployed in http://medialize.github.io/sass.js/) when a compilation fails all we get is:
Unknown Error: you need to compile libsass.js with exceptions to get proper error messages

Thanks.

@rodneyrehm
Copy link
Member

I see what you mean. You're saying that you're not getting the actual error messages as returned by libsass exposed in JS.

When compiling invalid scss:

Sass.compile(".m { width: $foobar; }");

internally the following error is raised and caught:

"TypeError: Cannot read property '0' of null
    at Object.Sass.compile (http://test.dev/medialize/sass.js/src/sass.js:149:47)
    at <anonymous>:2:6
    at Object.InjectedScript._evaluateOn (<anonymous>:777:140)
    at Object.InjectedScript._evaluateAndWrap (<anonymous>:710:34)
    at Object.InjectedScript.evaluate (<anonymous>:626:21)"

externally you get the following error object:

{
  line: null,
  message: "Unknown Error: you need to compile libsass.js with exceptions to get proper error messages"
}

The culprit is within sass.js itself. When originally written, errors were returned in a different format than they are now. Line 148 was responsible for cleaning the error message. An it is now the reason things are failing.

What was added originially because I did not fully understand what emscripten was doing with the C++ Exceptions, was now conceiling an error in my own code because libsass changed the syntax of its errors.

The is fixed and released as v0.6.3

@rodneyrehm rodneyrehm added the bug label Mar 3, 2015
@afiestas
Copy link
Author

afiestas commented Mar 3, 2015

Oh, thanks! I was really mislead by the error plus had the version hardcoded at 0.6.2.

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

No branches or pull requests

2 participants