Open
Description
@lwc/lwc/no-unsupported-ssr-properties
and @lwc/lwc/no-restricted-browser-globals-during-ssr
check all functions in a component for unsafe SSR practices. However, not all functions need to be SSR safe, only those called on first paint.
Example:
export default class ExampleButton {
handleFocus() {
this.dispatchEvent(new CustomEvent('focus')); //@lwc/lwc/no-unsupported-ssr-properties error
console.log(window.location.href) //@lwc/lwc/no-restricted-browser-globals-during-ssr error
}
}
Relevant Slack Thread: https://salesforce-internal.slack.com/archives/C5W3E40TC/p1719415297404469