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
Resolve issue with SSR in Svelte Kit #22
Comments
Is there any documentation or example on how to implement it the right way ? As far as I understand it correctly the package already has the pkg.svelte attribute set in version 4.0.3: {
...
"svelte": "./index.js",
...
} |
@dextermb I just tested:
<script lang="ts">
import { AcademicCap, Icon } from "svelte-hero-icons";
</script>
<Icon src={AcademicCap} size="1rem" /> Is the exact reproduction failing for you ? |
@JustinVoitel Please take a look at my example repository: dextermb/bug-hero-icons-svelte-kit I'm using Svelte Kit using JS not TS so that might be an issue. However as mentioned in the initial bug thread it only has been happening in the recent Svelte Kit versions. If you don't feel it's an issue with your Heroicons package then feel free to comment there to get them to investigate further |
@dextermb can you try svelte-hero-icons@next and check if it is working now ? |
Unfortunately still getting the issue. Here's the stack:
This was created by using dextermb/bug-hero-icons-svelte-kit. |
1 similar comment
Unfortunately still getting the issue. Here's the stack:
This was created by using dextermb/bug-hero-icons-svelte-kit. |
@dextermb I tried your project and could bring it to work replacing this in "svelte-heroicons": "npm:svelte-hero-icons@^4.0.3", with "svelte-hero-icons": "next", and in import { Icon, Home } from 'svelte-hero-icons'; Please try this out! |
@JustinVoitel Without the alias it does seem to work. This potentially suggests that it's an issue with |
Alright this seems to be the reason ^^ What was the reason behind the alias ? I never used anything like this :D |
The "Hero icons" branding is all one word haha (heroicons). I've commented back on the Svelte Kit issue so hopefully they'll look into why the alias is causing the error. |
Ahh yea that was my mistake ^^ when I initialized the project I didn't look at the correct wording 😅 Also if you didn't know: I created a successor library (actually libraries) to this package where you can use multiple Icon sets with the same component. And I fixed the naming of the heroicons set, e.g you would use it like this: '''svelte ... |
Looks like it's a bug in |
Hi
I raised a bug with Svelte Kit where issues were happening when attempting to SSR. You can find the bug thread here (sveltejs/vite-plugin-svelte#293).
Are you able to implement the suggested fix?
The text was updated successfully, but these errors were encountered: