-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svelte:options customElement #56
Comments
is it an error or a warning? a bit annoying, but if we want to publish the banner as a WebComponent too, we need to include that. I'm not sure there is a way around it. |
Hi, Sorry it was a warning. Might I suggest appending to your Svelte example the modification to svelte.config.js in the Readme.md. Thanks for the update, Pierre |
It says in the warning what you need to do, so not sure this is necessary. I feel like this is an issue within the way Svelte works, since you don't actually want custom element output in a regular svelte project. the compiler should know that you're seeing the options tag in a project dependency, not the main project, and not warn. i'll raise an issue with Svelte (or you can) |
@antony did you make an issue? |
Hey Yury, no, I've not had time.
Feel free to do it if need be.
…On Sun, 5 Nov 2023 at 06:48, Yury Zhuravlev ***@***.***> wrote:
@antony <https://github.com/antony> did you make an issue?
—
Reply to this email directly, view it on GitHub
<#56 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVORLXTNPGMIUNKZFF6W3YC4ZCVAVCNFSM6AAAAAA5Z5WYTSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGY2TIMRWHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Actually solved, seems I used an old version of sveltekit |
Still shows an error on latest sveltekit "@sveltejs/kit": "^2.5.0". compilerOptions: {
customElement: true,
}, pre-rendering with static adapter kit breaks and CSS is no longer loaded from Svelte pages and components. |
@belte42 because you're trying to mark your entire project as a custom element, which won't work. The "did you forget to add" If it bothers you a lot, please raise a SvelteKit issue and I'll discuss it with the others and see if I can implement a fix - but at the moment, I don't have time to do it. |
Hi,
A compile error is generated with version 11:
[vite-plugin-svelte] /node_modules/@beyonk/gdpr-cookie-consent-banner/src/lib/Ba
nner.svelte:1:16 The 'customElement' option is used when generating a custom element. Did you forget the 'customElement: true' compile option
?
1: <svelte:options customElement="cookie-consent-banner" />
To resolve this, I had to include in my svelte.config.js the following:
compilerOptions: {
customElement: true,
},
It does not seem right that I have to mod my config to compile.
Thanks,
Pierre
The text was updated successfully, but these errors were encountered: