`vinxi build` fails with RollupError during unecessary "Preparing app for node-server... "

Hey there, so when I run npm run build which really runs vinxi build as of solid 0.4.* it works locally. But when run as part of a github action, it fails with
[success] [vinxi] Generated public .output/public
[info] [vinxi] Initializing prerenderer
Error: [nitro] RollupError: Could not resolve "./ThemeContext" from "node_modules/@suid/system/useTheme.js"


undefined
Error: Could not resolve "./ThemeContext" from "node_modules/@suid/system/useTheme.js"
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)
[success] [vinxi] Generated public .output/public
[info] [vinxi] Initializing prerenderer
Error: [nitro] RollupError: Could not resolve "./ThemeContext" from "node_modules/@suid/system/useTheme.js"


undefined
Error: Could not resolve "./ThemeContext" from "node_modules/@suid/system/useTheme.js"
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)
So, this seems to happend AFTER the .output/public folder is created, the next step is Initializing prerenderer. But I'm not using any node-server, how can I tell it that it doesn't have to do that during CI steps?
12 Replies
Bersaelor
BersaelorOP12mo ago
my vite-config just says:
export default defineConfig({
start: {
ssr: false,
server: 'static',
},
export default defineConfig({
start: {
ssr: false,
server: 'static',
},
so I really only need a statically built CSR app. so the whole Preparing app for node-server... isn't needed? versions:
"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"
},
"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"
},
Birk Skyum
Birk Skyum12mo ago
Are you able to reproduce this in ie stackblitz?
Bersaelor
BersaelorOP12mo ago
ah, yes, never used stackblitz, let me research how to do that is there a stackblitz solid-start template for 0.4.* somewhere? trying to set one p from scratch but it's fighting me a little. I did add all the usual solid-start files but now I don't know how to tell it to run vinxi to create the output folder when first I set up the new project with "@solidjs/start": "^0.4.4", it worked. Then I deleted my package-lock, ran install again, at which point it went to 0.4.8 and had the above RollupError vinxi dev works fine though, it's only when I run vinxi build that it fails to generate the ouput same with 0.4.9
Birk Skyum
Birk Skyum12mo ago
StackBlitz
Solid-start Basic Example - StackBlitz
Run official live example code for Solid-start Basic, created by Solidjs on StackBlitz
Bersaelor
BersaelorOP12mo ago
mhmm, that doesn't seem to work either:
(node:12) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
9:00:47 PM [vite] Error when evaluating SSR module /node_modules/@suid/material/styles/createPalette.jsx: failed to import "@suid/system/colorManipulator"
|- /home/projects/github-b1xtbj-rdgvk6/node_modules/@suid/system/colorManipulator.js:21
export function hexToRgb(color) {
(node:12) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
9:00:47 PM [vite] Error when evaluating SSR module /node_modules/@suid/material/styles/createPalette.jsx: failed to import "@suid/system/colorManipulator"
|- /home/projects/github-b1xtbj-rdgvk6/node_modules/@suid/system/colorManipulator.js:21
export function hexToRgb(color) {
https://stackblitz.com/edit/github-b1xtbj-rdgvk6?file=package.json ah you know what, maybe I need to use the suid-vite plugin again? Since the 0.4.* vite.config.ts doesn;'t have a solid-plugin anymore, maybe that is missing! the old 0.3.* world, I used to have:
export default defineConfig({
plugins: [
solid({ adapter: awsAdapter() }),
suidPlugin()
],
export default defineConfig({
plugins: [
solid({ adapter: awsAdapter() }),
suidPlugin()
],
problem is, tha the new defineConfig(baseConfig?: SolidStartInlineConfig) in @solidjs/start/config doesn't have a plugins parameter anymore... (although I do wonder, since my site built fine a few days back, with just the default solid-start vite.config.ts , why it fails now)
Birk Skyum
Birk Skyum12mo ago
i don't get any errors anymore with the suid plugin. how can i test i the theme works?
Bersaelor
BersaelorOP12mo ago
here's an example theme file:
Bersaelor
BersaelorOP12mo ago
Konrad Feiler
StackBlitz
Solid-start Basic Example (forked) - StackBlitz
Run official live example code for Solid-start Basic, created by Solidjs on StackBlitz
Bersaelor
BersaelorOP12mo ago
then you add it in the app.tsx:
import { ThemeProvider } from '@suid/material/styles';
import theme from './Theme';

export default function App() {
return (
<Router
root={props => (
<ThemeProvider theme={theme}>
import { ThemeProvider } from '@suid/material/styles';
import theme from './Theme';

export default function App() {
return (
<Router
root={props => (
<ThemeProvider theme={theme}>
and then for example you can use <Paper> or <Typography> which will use the theme
Bersaelor
BersaelorOP12mo ago
a more advances theme from one of my other projects:
Birk Skyum
Birk Skyum12mo ago
that's actually pretty cool - thanks for sharing. Will consider it for the next project.
Bersaelor
BersaelorOP12mo ago
especially useful when you create a functional service without a proper designer, and everyone is fine if it looks more or less like google sheets or gmail UI
Want results from more Discord servers?
Add your server