npm run build fails if outDir is changed
import { defineConfig } from "@solidjs/start/config";
export default defineConfig({
vite: {
build: {
outDir: "dist"
},
},
server: {
preset: "aws-lambda",
}
});
import { defineConfig } from "@solidjs/start/config";
export default defineConfig({
vite: {
build: {
outDir: "dist"
},
},
server: {
preset: "aws-lambda",
}
});
> build
> vinxi build
vinxi v0.3.11
β Building your app...
π¦ Compiling ssr router...
vinxi building router ssr in http mode
vite v5.3.1 building SSR bundle for production...
β 49 modules transformed.
dist/.vite/manifest.json 1.72 kB
dist/assets/index-7whypOeP.css 0.31 kB
dist/assets/ssr-CSUIEcYF.css 0.38 kB
dist/assets/HttpStatusCode-DH8IeaZe.js 0.28 kB
dist/about.js 0.29 kB
dist/_...404_.js 0.52 kB
dist/index.js 0.62 kB
dist/assets/index-BhCdQPVl.js 2.74 kB
dist/ssr.js 24.93 kB
β built in 344ms
β build done 12:26:02 AM
π¦ Compiling client router...
vinxi building router client in client mode
vite v5.3.1 building for production...
virtual:#vinxi/handler/client (1:118): "default" is not exported by "src/entry-client.tsx", imported by "virtual:#vinxi/handler/client".
β 56 modules transformed.
dist/server-functions-manifest.json 0.03 kB β gzip: 0.04 kB
dist/.vite/manifest.json 1.64 kB β gzip: 0.40 kB
dist/assets/index-7whypOeP.css 0.31 kB β gzip: 0.22 kB
dist/assets/client-CSUIEcYF.css 0.38 kB β gzip: 0.27 kB
dist/assets/HttpStatusCode-DjTx85av.js 0.03 kB β gzip: 0.05 kB
dist/assets/about-D9a10H4Q.js 0.27 kB β gzip: 0.22 kB
dist/assets/_...404_-BZfb9gVQ.js 0.52 kB β gzip: 0.37 kB
dist/assets/index-DdD6Dmru.js 0.73 kB β gzip: 0.45 kB
dist/assets/client-CxHr6IfA.js 21.69 kB β gzip: 8.69 kB
dist/assets/index-BhR3EnB2.js 23.91 kB β gzip: 9.25 kB
β built in 289ms
β build done 12:26:02 AM
π¦ Compiling server-fns router...
vinxi building router server-fns in http mode
ERROR ENOENT: no such file or directory, open '/Users/urf/Repositories/solidstart-starter/lambda/.vinxi/build/client/_build/server-functions-manifest.json' 12:26:02 AM
at readFileSync (node:fs:448:20)
at config (node_modules/@vinxi/server-functions/server.js:49:5)
at runConfigHook (node_modules/vite/dist/node/chunks/dep-BcXSligG.js:66942:25)
at async resolveConfig (node_modules/vite/dist/node/chunks/dep-BcXSligG.js:66393:12)
at async Module.build (node_modules/vite/dist/node/chunks/dep-BcXSligG.js:65459:18)
at async createViteBuild (node_modules/vinxi/lib/build.js:321:17)
at async createRouterBuild (node_modules/vinxi/lib/build.js:438:2)
at async node_modules/vinxi/lib/build.js:59:5
at async createBuild (node_modules/vinxi/lib/build.js:58:4)
at async Object.run (node_modules/vinxi/bin/cli.mjs:227:5)
at async runCommand (node_modules/citty/dist/index.mjs:316:16)
at async runCommand (node_modules/citty/dist/index.mjs:307:11)
at async runMain (node_modules/citty/dist/index.mjs:445:7)
ERROR ENOENT: no such file or directory, open '/Users/urf/Repositories/solidstart-starter/lambda/.vinxi/build/client/_build/server-functions-manifest.json'
> build
> vinxi build
vinxi v0.3.11
β Building your app...
π¦ Compiling ssr router...
vinxi building router ssr in http mode
vite v5.3.1 building SSR bundle for production...
β 49 modules transformed.
dist/.vite/manifest.json 1.72 kB
dist/assets/index-7whypOeP.css 0.31 kB
dist/assets/ssr-CSUIEcYF.css 0.38 kB
dist/assets/HttpStatusCode-DH8IeaZe.js 0.28 kB
dist/about.js 0.29 kB
dist/_...404_.js 0.52 kB
dist/index.js 0.62 kB
dist/assets/index-BhCdQPVl.js 2.74 kB
dist/ssr.js 24.93 kB
β built in 344ms
β build done 12:26:02 AM
π¦ Compiling client router...
vinxi building router client in client mode
vite v5.3.1 building for production...
virtual:#vinxi/handler/client (1:118): "default" is not exported by "src/entry-client.tsx", imported by "virtual:#vinxi/handler/client".
β 56 modules transformed.
dist/server-functions-manifest.json 0.03 kB β gzip: 0.04 kB
dist/.vite/manifest.json 1.64 kB β gzip: 0.40 kB
dist/assets/index-7whypOeP.css 0.31 kB β gzip: 0.22 kB
dist/assets/client-CSUIEcYF.css 0.38 kB β gzip: 0.27 kB
dist/assets/HttpStatusCode-DjTx85av.js 0.03 kB β gzip: 0.05 kB
dist/assets/about-D9a10H4Q.js 0.27 kB β gzip: 0.22 kB
dist/assets/_...404_-BZfb9gVQ.js 0.52 kB β gzip: 0.37 kB
dist/assets/index-DdD6Dmru.js 0.73 kB β gzip: 0.45 kB
dist/assets/client-CxHr6IfA.js 21.69 kB β gzip: 8.69 kB
dist/assets/index-BhR3EnB2.js 23.91 kB β gzip: 9.25 kB
β built in 289ms
β build done 12:26:02 AM
π¦ Compiling server-fns router...
vinxi building router server-fns in http mode
ERROR ENOENT: no such file or directory, open '/Users/urf/Repositories/solidstart-starter/lambda/.vinxi/build/client/_build/server-functions-manifest.json' 12:26:02 AM
at readFileSync (node:fs:448:20)
at config (node_modules/@vinxi/server-functions/server.js:49:5)
at runConfigHook (node_modules/vite/dist/node/chunks/dep-BcXSligG.js:66942:25)
at async resolveConfig (node_modules/vite/dist/node/chunks/dep-BcXSligG.js:66393:12)
at async Module.build (node_modules/vite/dist/node/chunks/dep-BcXSligG.js:65459:18)
at async createViteBuild (node_modules/vinxi/lib/build.js:321:17)
at async createRouterBuild (node_modules/vinxi/lib/build.js:438:2)
at async node_modules/vinxi/lib/build.js:59:5
at async createBuild (node_modules/vinxi/lib/build.js:58:4)
at async Object.run (node_modules/vinxi/bin/cli.mjs:227:5)
at async runCommand (node_modules/citty/dist/index.mjs:316:16)
at async runCommand (node_modules/citty/dist/index.mjs:307:11)
at async runMain (node_modules/citty/dist/index.mjs:445:7)
ERROR ENOENT: no such file or directory, open '/Users/urf/Repositories/solidstart-starter/lambda/.vinxi/build/client/_build/server-functions-manifest.json'
7 Replies
Not all vite options are appropriate in solid-start
app.config
because the information needs to be sent to Nitro, which will then proxy anything to vite appropriately. To change the output directory, set the server.output.dir
property instead:
export default defineConfig({
// ...rest of the config
server: {
preset: 'aws-lambda',
output: { dir: 'dist' },
},
});
export default defineConfig({
// ...rest of the config
server: {
preset: 'aws-lambda',
output: { dir: 'dist' },
},
});
Thanks! Is this also why when I deploy I see my .css files served but not my .js files?
I enabled static serve in nitro
export default defineConfig({
server: {
preset: "aws-lambda",
serveStatic: true,
}
});
export default defineConfig({
server: {
preset: "aws-lambda",
serveStatic: true,
}
});
Someone else may have a better answerβ¦Β I think that's dependent on the preset. For aws-lambda, that may be required
To help make it more clear for anyone here is a lambda I uploaded the basic template to: https://vo3k6kzh4rq2fvgd2vmz26euq40kkwyk.lambda-url.eu-north-1.on.aws
Maybe the files are there but isn't being served correctly. I see it there in the lambda files.
On further testing it does look like the file can be returned. Maybe some encoding issue that browsers don't like?
And this is an issue with only some JS files?
It looks like the files dont have valid js syntax
If I open it in vscode there's no highlighting on them.