When there is a LWC using svg
use
tag like suggested on Lightning design system site and Lightning Web Security
is turned on (the setting Use Lightning Web Security for Lightning web components on Session Settings
), it breaks LWC with an error
Error during LWC component connect phase: [String.prototype.startsWith called on null or undefined]
Listing of example component
<template>
Web Security
<lightning-combobox
label="Select"
options={svgOptions}
onchange={handleSelection} >
</lightning-combobox>
<svg class="slds-icon slds-icon-text-default" aria-hidden="true">
<use xlink:href={svg}></use>
</svg>
</template>
Listing of example JS file
import { LightningElement } from 'lwc';
export default class WebSecurity extends LightningElement {
svgOptions = [{label:'Utility',value:'/assets/icons/utility-sprite/svg/symbols.svg#notification'},{label:'Standard & Custom',value:'/assets/icons/standard-sprite/svg/symbols.svg#account'}];
handleSelection(event) {
this.svg = event.detail.value;
}
}