lwc icon indicating copy to clipboard operation
lwc copied to clipboard

Convert warnings logged from Unexpected LWC stylesheet content to errors

Open jye-sf opened this issue 1 year ago • 0 comments

Description

https://github.com/salesforce/lwc/pull/3443 adds logging and reporting when an unregistered stylesheet is evaluated by the engine. The end goal here is to lock this functionality down completely and throw an error when an invalid stylesheet is detected. This is potentially a breaking a change, so we'll evaluate the risk of breakage through the reporting API.

End Goal

// Check that this stylesheet was generated by our compiler
if (!isStylesheetRegistered(stylesheet)) {
    throw new Error(TypeError, `Unexpected LWC stylesheet content found for component <${vm.tagName.toLowerCase()}>.`);
}

jye-sf avatar Apr 05 '23 22:04 jye-sf