SolidJSS
SolidJSโ€ข17mo agoโ€ข
4 replies
raf

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

SyntaxError: The requested module 'file://C:/Users/RAFLYMAULANA/Documents/Github/@takodotid/v2-frontend/node_modules/.pnpm/solid-js@1.8.22/node_modules/solid-js/web/dist/server.js' does not provide an export


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
export default defineConfig({
    vite: {
        resolve: {
            alias: {
                "@": resolve(dirname(fileURLToPath(import.meta.url)), "src"),
                "@assets": resolve(dirname(fileURLToPath(import.meta.url)), "assets"),
            },
        },
    },
    server: {
        static: true,
        prerender: {
            routes: ["/", "/about"],
        },
    },
});
Was this page helpful?