-
Notifications
You must be signed in to change notification settings - Fork 350
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
Compilation crashes node from within Promise #2075
Comments
Can you provide a minimal reproduction, either as a repo or just the Sass code that you're compiling with the JS code above? |
I'll try to set one up this week. Is there any chance that there was some kind of bug in an earlier release that caused uncaught errors in |
the error message looks like a bug in your Sass file, where |
Yes, but it shouldn't crash an async compile call. It's just by example here, to demonstrate the issue. |
It does not crash the call. It rejects the promise, which is the expected way to return errors. As you don't show how you call your |
Your assumption is incorrect I'm afraid - I can assure you it does, as I witnessed it many times. Note the following:
The last line shows as Node's process dies. The const styles = await renderStyles(sassFilesIndex, type, themePrefix); And this is called from within an async
I would expect sass sync calls, when throwing exceptions, to still be caught by the same async handlers as any other normal call would be. Is it possible that something in the dart version, in sync mode, is causing some error that cannot be caught by the Javascript async logic? EDIT: I'll do my best to create a reproduction tonight/tomorrow for this. |
None of the code snippets you shared until now show an async error handler. |
A lot of it is internal code in my company, which is why I haven't shown it. I've explained that it's wrapped in express-promise-router, which does provide all-encompassing async error handling. Again, I'll try to get a reproduction added here shortly. It'd be great to keep the comments constructive.. |
Haven't had time to test or reproduce, and it hasn't been an issue lately. I'll reopen if I come across it again, and am able to create a reproduction. |
Hi! I'm seeing some weird behaviour in my app that uses
sass
to compile styles in-app. When compilation catches some invalid SASS syntax, it not only throws an error, but it crashes the entire process altogether:This is my basic usage:
Any idea what I'm doing wrong? This promise has a catch block which catches other errors before this point, but if SASS compilation fails node dies like you see above.
I'm using the latest
sass
version:EDIT: I wonder if the
compileAsync
mode would help with this, but then the documentation makes that sound like a poor idea:The text was updated successfully, but these errors were encountered: