swordev / suid

A port of Material-UI (MUI) built with SolidJS.
https://suid.io
MIT License
660 stars 47 forks source link

Rollup-Error in latest version of `solid-start` #277

Closed Bersaelor closed 6 months ago

Bersaelor commented 6 months ago

Hey there,

so I don't think I got this error before, It just seems to happen with the latest version of solid start:

✔ Generated public .output/public                                                                            vinxi 4:39:50 PM
ℹ Initializing prerenderer                                                                                   vinxi 4:39:50 PM

 ERROR  RollupError: Could not resolve "./ThemeContext" from "node_modules/@suid/system/useTheme.js"          nitro 4:39:51 PM

undefined

 ERROR  Could not resolve "./ThemeContext" from "node_modules/@suid/system/useTheme.js"                             4:39:51 PM

  at error (node_modules/rollup/dist/es/shared/parseAst.js:337:30)
  at ModuleLoader.handleInvalidResolvedId (node_modules/rollup/dist/es/shared/node-entry.js:18000:24)
  at node_modules/rollup/dist/es/shared/node-entry.js:17960:26
  at async Promise.all (index 0) 

 ERROR  Could not resolve "./ThemeContext" from "node_modules/@suid/system/useTheme.js"   

Here's my list of dependencies:

  "dependencies": {
    "@solidjs/router": "^0.10.6",
    "@solidjs/start": "0.4.8",
    "@suid/icons-material": "^0.6.11",
    "@suid/material": "^0.15.1",
    "aws-amplify": "^6.0.10",
    "solid-js": "^1.8.8",
    "unstorage": "1.10.1",
    "vinxi": "0.1.2"
  },

The previous vinxi-step already creates the .output/public static files for the site, so that is fine. npm run dev / vinxi dev also seems to work fine.

Just thus weird Initializing prerenderer step of the vinxi build fails

Bersaelor commented 6 months ago

My bad, I missed adding the suid/vite-plugin.

In the vite.config.ts:

import { defineConfig } from "@solidjs/start/config";
import suidPlugin from '@suid/vite-plugin';

export default defineConfig({
  plugins: [suidPlugin()],
  start: { 
    ssr: false,
    server: 'static',
  },
}