template not exported from solidjs/web
I'm trying to use the solid-spinner library https://github.com/lenniezelk/solid-spinner but am getting an error that solidjs/web doesn't export 'template'. Does anyone know what's going on here?
GitHub
GitHub - lenniezelk/solid-spinner
Contribute to lenniezelk/solid-spinner development by creating an account on GitHub.
![](https://cdn.answeroverflow.com/1141717643854872607/image.png)
12 Replies
Usually this happens due to a combination of client side code with ssr version of solid
oh interesting
Ryan Carniato (@RyanCarniato)
The solution to 90% of the Vite problems people report to me:
optimizeDeps.exclude
ssr.noExternal
Likes
331
Twitter
how do I use code like this then if I have ssr? is that just not possible?
lol
I'll give it a try
It depends on the library. Some libraries there's nothing you can do, some of them that tweet works
does optimizeDeps go in the ssr options as well?
No
It's top level
so like
In the vite config, not in the solid plugin
Yes
It looks like the spinner library ships esm and source (which is the default for the rollup solid plugin). The esm is the client build, and you basically need a way to get solid to compile from source for the server side
Maybe those vite options make that happen, maybe they don't, it's been a long time since I've tried wrangling with server side deps
Personally, I ship a separate cjs build for server side for my libraries
it looks like I am not getting that error anymore so that's cool
now I gotta actually try to render a spinner
Yeah, it could be the library itself doesn't work with server side... Gotta see
It seems to be all purely svg based (no use of browser apis), so I'd assume it works
successfully got it working now that I'm no longer putting my kid down for a nap 🤣
thanks for the help