-
Notifications
You must be signed in to change notification settings - Fork 358
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
Improper handling of Node.js importers that use custom URL schemes #1138
Comments
I'm a bit confused by what you're asking for here. What would you expect Sass to do in this situation? It doesn't have any concept of |
Ok, I see how I could have worded this better. Of course, I don't expect sass to know how to handle So in the case when an importer throws an error, I would expect to see that error message appear. And this works sometimes, like here: But if an error is thrown deeper down the tree, it gives me the error about the file scheme, e.g.: And the behavior when I return null is similar. E.g. here I would get a file not found error: |
Okay, I see. This is definitely a bug then. We'll take a look. |
To be clear: are you using the Node.js importer API, or the Dart importer API? |
I checked and confirmed that this only occurs with the Node API (updated the title to match) |
Sorry to take so long to circle back to this! I'm working on it now. |
When an error occurred in a stylesheet loaded by a custom importer with a custom URL scheme, the Node error wrapper tried to convert that URL into a path and ended up crashing. Closes #1138
How can I fix this problem? |
In #1100 it was suggested that our custom importer uses URL's like:
This works to some extend (at least since sass
1.26.0
and higher), but only if we can successfully resolve and return the contents.However, in the case where either an error is thrown, or the contents does not exist (and thus we return null), then dart-sass expects the url to have a file scheme. And dart-sass would throw something like:
The text was updated successfully, but these errors were encountered: