You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After an npm update (have been using Svelte 5.1.16 before), quite a few components fail to compile with an error message that does not make sense to me. I was able to pin down the version that broke everything for me. It happened with 5.2.8. When I pin the version to =5.2.7, everything is fine, but everything after does not even compile anymore.
{expression} is invalid inside <table>
It makes sense when you for instance put a div inside a td or something like that, which is not allowed by definition, but it don't get the issue in this situation:
The error message comes up for style:max-width={maxWidth}. It does not for the shorthand style:width, but it does even here if I use the long syntax style:width={width}. The error only shows up on the very first occurence of the issue, until I resolve this one, so I have no idea what other parts are affected. It might be a rabbit whole. For instance, 3 lines below I am doing something like <tr style:grid-template-columns={gridTemplateColumns()}> which fails as well with the exact same error, if I remove the lines above.
Reproduction
When I get rid of everything else, I am doing the following:
<scriptlang="ts">
let {maxWidth}: {maxWidth?:string} =$props();
</script>
<tablestyle:max-width={maxWidth}>
</table>
… HTML
fixes#14466
The logic introduced in #14395 was flawed - not every text or expression outside the template is the child of an attribute. This turns it around: We know that every child of a fragment is inside the template, so we ignore all text/expression tags that are not child of a fragment
Describe the bug
After an
npm update
(have been using Svelte5.1.16
before), quite a few components fail to compile with an error message that does not make sense to me. I was able to pin down the version that broke everything for me. It happened with5.2.8
. When I pin the version to=5.2.7
, everything is fine, but everything after does not even compile anymore.{expression}
is invalid inside<table>
It makes sense when you for instance put a
div
inside atd
or something like that, which is not allowed by definition, but it don't get the issue in this situation:The error message comes up for
style:max-width={maxWidth}
. It does not for the shorthandstyle:width
, but it does even here if I use the long syntaxstyle:width={width}
. The error only shows up on the very first occurence of the issue, until I resolve this one, so I have no idea what other parts are affected. It might be a rabbit whole. For instance, 3 lines below I am doing something like<tr style:grid-template-columns={gridTemplateColumns()}>
which fails as well with the exact same error, if I remove the lines above.Reproduction
When I get rid of everything else, I am doing the following:
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: