-
Notifications
You must be signed in to change notification settings - Fork 25
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
Define behavior when @import
fails
#27
Comments
I think the sheet should still parse; that matches current CSS behavior, and I don't know of anyone having trouble with that. (If we're dispatching load events, it can send an event alerting you to this failure, but that's the extent of it.) |
In what scenario would something like |
I wasn't intending for it to failable; it returns a Promise just so that we don't block the script on a potentially-large CSS parse.
As I said in my comment, this could be communicated thru load events fired on the stylesheet, maybe? |
Just to make sure: in JS, if you import a module that imports sub-modules, and one of the sub-modules fails, the import as a whole still succeeds, right? If so, then great, that's consistent with my expressed opinion (always succeed if the top-level load succeeds, maybe communicate sub-resource failures on the load event). Whichever way it goes, tho, we should be consistent with the JS module story. |
So I just tried it here https://glitch.com/edit/#!/simple-show and it seems like the import fails (script.js imports uppercase.js which tries to import from invalid.js that doesn't exist) and the console doesn't show the uppercase text as it should. So I guess for our case we should also not suceed? (or am I doing something wrong with the code?) |
Your code looks good - if I fork it and remove the offending import, it successfully logs to the console. So to be consistent, that suggests that any failed imports should cause the parent stylesheet's load promise to reject. |
From @calebdwilliams #25 (comment)
The text was updated successfully, but these errors were encountered: