Monorepo error with SolidStart `__vite_ssr_import_0__.template is not a function`
I've got a shared UI library (compiled into esm + cjs with vite) that is used with both a regular SolidJS app and a SolidStart app. It's working fine in the SolidJS app, but when importing the lib in the SolidStart app, I'm getting a pretty cryptic error:
4 Replies
seems like your library doesn't support SSR
using Vite for authoring libraries isn't really recommended for Solid because of the requirement. I'd recommend https://github.com/solidjs-community/rollup-preset-solid
GitHub
GitHub - solidjs-community/rollup-preset-solid: A small opinionated...
A small opinionated preset for rollup to bundle your solid libraries with rollup. - GitHub - solidjs-community/rollup-preset-solid: A small opinionated preset for rollup to bundle your solid librar...
hmmm the thing is the UI library uses SCSS, so when i tried the rollup plugin it crashes when it encountered the scss import
any ideas on how to support SSR via the vite config? it outputs esm + cjs so i can't understand what could possibly be the issue here. all it exports is a button component
ah, i was copying hope ui's build configs assuming that they supported ssr. turns out they don't rip haha
you need to use a scss plugin for rollup