Cannot build SSG
So i'm trying to build SSG instead of SPA so it works better with SEO, however during prerendering, it always return this error
during building everything fine, if i compile to SPA everything is working fine too, however when trying to build SSG, it just fail, if the result output index.html, it just empty
<div id="#app"></div>
with no content
my app.config.ts
3 Replies
fyi, this is a simple solid start app, and i found out that solid ssr is wonky af
it turns out the error happens since i remove
ssr:false
to allow prerenderingDid you try to remove the path alias in the config? Maybe this messes up the build.
"does not provide an export"
What's the rest of the error?
I'm guessing that if you made a
vite.resolve.alias
config, then you will also need to configure that for other cases. Vite is only for dev mode I believe. Maybe you can put an importmap
in your app to set the aliases for other modes.
Or better yet, don't use the alias for now, get it working with just relative paths first, then go from there.
The thing is, Solid Start is built on 3rd-party build tools, so it cannot guess everything you want to do for all tools based on the config for any one tool.
F.e., if you configure vite.resolve.alias, then you'll also need to configure paths
in tsconfig for TypeScript, etc, etc, etc.