poppa / sveltekit-svg

SvelteKit plugin that makes it possible to import SVG files as Svelte components, inline SVG code or urls
MIT License
235 stars 23 forks source link

Not a valid SSR component #50

Closed cristianvogel closed 1 year ago

cristianvogel commented 1 year ago

Hi!

I would like to use the Component style rendering import, but I get this error in my project.

Error: <BackgroundSvg> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <BackgroundSvg>. at Module.validate_component

i am on

   "svelte": "^4.2.0",
    "svelte-check": "^3.4.6",
"@sveltejs/adapter-auto": "^2.1.0",
    "@sveltejs/adapter-vercel": "^3.0.3",
    "@sveltejs/kit": "^1.5.0",
poppa commented 1 year ago

Hi @cristianvogel.

This unfortunately doesn't help me very much.

Might your problem be due to a misconfiguration like this?

cristianvogel commented 1 year ago

Hi ... I got the component style working. Seems like I had a mixture of Path config mistake ( forgetting the trailing slash ) and an invalid attribute jarring the SVGO parser. Which summarised to a 'not a valid SSR component'