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
I'm getting this error when building a simple app that has a component with a child named 'Link'. I'll have a super simple example below, but it looks like what's happening is that since link is a valid html element that expects no children, the parser is assuming my Link component is that and trying to set a child when none is expected.
If I change Link to anything else (Widget, Link2, etc.) everything works fine. I'd certainly prefer to name my component anything I'd like, so long as it starts with a capital letter and have everything just work. If we want to treat html elements as reserved words, then I think a better error would be really helpful since it took quite awhile to figure that out!
Error transforming /home/andrew/learning/svelte/router/src/App.html with 'svelte' plugin: Cannot read property 'children' of undefined
TypeError: Error transforming /home/andrew/learning/svelte/router/src/App.html with 'svelte' plugin: Cannot read property 'children' of undefined
at text (/home/andrew/learning/svelte/router/node_modules/svelte/compiler/parse/state/text.js:10:18)
at parse (/home/andrew/learning/svelte/router/node_modules/svelte/compiler/parse/index.js:120:11)
at Object.compile (/home/andrew/learning/svelte/router/node_modules/svelte/compiler/index.js:6:17)
at Object.transform (/home/andrew/learning/svelte/router/node_modules/rollup-plugin-svelte/dist/rollup-plugin-svelte.cjs.js:24:18)
at /home/andrew/learning/svelte/router/node_modules/rollup/src/utils/transform.js:19:35
at process._tickCallback (internal/process/next_tick.js:103:7)
I did create a test with this that fails, but as I said above, I'm not sure if this is a bug or expected behavior.
Thanks, and I'm really digging this project so far!
The text was updated successfully, but these errors were encountered:
I'm not sure if this is a bug or expected behavior.
Good question! It's certainly surprising behaviour. Easy fix is to require void element names to be lowercase, which would fail with some valid HTML but I'm not sure if that's a real problem or not. #138
I'm getting this error when building a simple app that has a component with a child named 'Link'. I'll have a super simple example below, but it looks like what's happening is that since link is a valid html element that expects no children, the parser is assuming my Link component is that and trying to set a child when none is expected.
If I change Link to anything else (Widget, Link2, etc.) everything works fine. I'd certainly prefer to name my component anything I'd like, so long as it starts with a capital letter and have everything just work. If we want to treat html elements as reserved words, then I think a better error would be really helpful since it took quite awhile to figure that out!
Link.html
Main.html
Stack trace of the error:
I did create a test with this that fails, but as I said above, I'm not sure if this is a bug or expected behavior.
Thanks, and I'm really digging this project so far!
The text was updated successfully, but these errors were encountered: