Firefox throws and unsupported error on:
import sheet from '/Vanilla/ScrollGrid.css' assert {type: 'css'};
Can I use says Unsupported.
and "Missing )" error after:
myCSSMod = await import(userStyles, { assert: {type: "css"} })
Can I Use says ok.
If I remove all asserts the IMPORT css statement throws: -
Loading module from “http://localhost/Vanilla/ScrollGrid.css” was blocked because of a disallowed MIME type (“text/css”).
Is there a feature detection work around for FireFox?
Indeed, it's not supported.
Can I Use does not say ok. The second link is for the console.assert()
function, which is unrelated.
If you search "import assert" you will see that only Chrome and Edge currently support it.
And unfortunately this is not really a function but a language construct (an operator to be exact), so detecting how much of it is supported is pretty much impossible. Just refer to Can I Use, or Firefox' compatibility table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With