pastelsky / bundlephobia

🏋️ Find out the cost of adding a new frontend dependency to your project
https://bundlephobia.com
MIT License
8.89k stars 221 forks source link

svelte:element is not valid where it is valid #790

Open shinokada opened 1 year ago

shinokada commented 1 year ago

Describe the bug

When I check flowbite-svelte, I get the following error:

/tmp/tmp-build/packages/build-flowbite-svelte-Icb/node_modules/flowbite-svelte/dist/paginations/PaginationItem.svelte Module build failed (from ./node_modules/svelte-loader/index.js): Error: ParseError: Valid <svelte:...> tag names are svelte:head, svelte:options, svelte:window, svelte:body, svelte:self, svelte:component or svelte:fragment (13:1) 11: </script> 12: 13: <svelte:element ^ 14: this={href ? 'a' : 'button'} 15: {href} at /var/www/bundlephobia/node_modules/svelte-loader/index.js:181:12 @ /tmp/tmp-build/packages/build-flowbite-svelte-Icb/node_modules/flowbite-svelte/dist/index.js 90:0-80 90:0-80 @ /tmp/tmp-build/packages/build-flowbite-svelte-Icb/index.js

My understanding of this error is that there is a problem with the Svelte component PaginationItem.svelte in your project. Specifically, the issue lies in the usage of the tag in that file.

The error message states that the tag is not a valid Svelte tag name. In Svelte, the valid tag names are svelte:head, svelte:options, svelte:window, svelte:body, svelte:self, svelte:component, or svelte:fragment. However, the code in PaginationItem.svelte is attempting to use as a tag, which is causing the error.

But svelte has svelte:element.

To Reproduce

Run flowbite-svelte on the website.

Expected behavior

Should not have any error.