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
In our company, we want to build a UI component library for use with several frontend frameworks. Therefore we have to build them as Web Components (aka custom elements). We are trying to build them with Svelte because Svelte is just cool.
We are using Rollup for this because we couldn't get it to work with Vite (maybe someone has a guide for Vite for custom elements as build output from Svelte files).
Our problem now is that everything seems to work, except Slots. We have a <slot /> in our Svelte component, but after compiling the Svelte component to a Web component, the slot does not work at all.
I tried the reproduction repository. It fails the install for me, something in the package.lock.json seems to be broken. If I remove it or use pnpm, it installs correctly and the slot feature works as expected.
Please provide a reproduction that does reproduce this.
Oh, sorry. I forgot this again. We have a company internal NPM registry, which mirrors the public one. I recreated the package-lock.json with the correct entries.
When I try this out, the first button just says "Hello", but it should say "Hello world!". The "Hello" comes from an attribute, the "world!" from the slot.
Describe the bug
In our company, we want to build a UI component library for use with several frontend frameworks. Therefore we have to build them as Web Components (aka custom elements). We are trying to build them with Svelte because Svelte is just cool.
We are using Rollup for this because we couldn't get it to work with Vite (maybe someone has a guide for Vite for custom elements as build output from Svelte files).
Our problem now is that everything seems to work, except Slots. We have a
<slot />
in our Svelte component, but after compiling the Svelte component to a Web component, the slot does not work at all.Reproduction
I created a reproduction repository with our Rollup setup https://github.com/vekunz/svelte-rollup-webcomponents-slot.
npm install
npm run package
demo.html
in browser.-> Slot content from
<my-button>
in demo.html is not shown in the browserLogs
System Info
Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: