Open nolanlawson opened 1 year ago
<svg>s with the xmlns:xlink attribute cause a runtime error that only occurs with dynamic VNodes (not static ones).
<svg>
xmlns:xlink
<template> <svg data-dynamic={foo} xmlns:xlink="http://www.w3.org/1999/xlink" ></svg> </template>
Result
Uncaught DOMException: Failed to execute 'setAttributeNS' on 'Element': 'http://www.w3.org/1999/xlink' is an invalid namespace for attributes.
The error is thrown from LWC here:
https://github.com/salesforce/lwc/blob/8111f1f4b758025ee7c9e54e28721d4e8637ab40/packages/%40lwc/engine-dom/src/renderer/index.ts#L84
...called from here:
https://github.com/salesforce/lwc/blob/8111f1f4b758025ee7c9e54e28721d4e8637ab40/packages/%40lwc/engine-core/src/framework/modules/attrs.ts#L55-L57
If you remove data-dynamic={foo} above, it will render correctly.
data-dynamic={foo}
Repro
This issue has been linked to a new work item: W-14246830
This is apparently not a regression; it repros in 2.41.4 (244) as well.
Error is thrown in Chrome, Firefox, and Safari.
Description
<svg>
s with thexmlns:xlink
attribute cause a runtime error that only occurs with dynamic VNodes (not static ones).Steps to Reproduce
Result
The error is thrown from LWC here:
https://github.com/salesforce/lwc/blob/8111f1f4b758025ee7c9e54e28721d4e8637ab40/packages/%40lwc/engine-dom/src/renderer/index.ts#L84
...called from here:
https://github.com/salesforce/lwc/blob/8111f1f4b758025ee7c9e54e28721d4e8637ab40/packages/%40lwc/engine-core/src/framework/modules/attrs.ts#L55-L57
If you remove
data-dynamic={foo}
above, it will render correctly.Repro