solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

[Bug?]: Vite server config is being ignored

Open stabldev opened this issue 1 year ago • 4 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Current behavior 😯

example app.config.ts:

export default defineConfig({
    vite: {
        server: {
            host: "127.0.0.1",
            port: 8080,
        },
        plugins: [],
    },
});

but this isnt working, its still running on port:3000

Expected behavior 🤔

Run server on specified PORT and HOST

Steps to reproduce 🕹

Steps:

1.Edit vite server options on app.config.ts 2.Run server 3. 4.

Context 🔦

A fix: https://nitro.unjs.io/deploy/runtimes/node#environment-variables in .env

PORT=3000
HOST=127.0.0.1

I think this is because Im not using vite-solid-plugin? Hope this helps someone at least.

Your environment 🌎

No response

stabldev avatar Apr 06 '24 10:04 stabldev

Solid start already configures vite-plugin-solid for you, so that's not the issue. The disconnect must be somewhere else.

atk avatar Apr 06 '24 11:04 atk

I suspect this is due to Vinxi. I added back the dev server options because some of them work. Others may not. Will need to double check with @nksaraf to get clarity on this.

ryansolid avatar Apr 08 '24 21:04 ryansolid

Yeah I feel like the host and port shouldnt be server config since you probably only mean the dev server. So I think the dev command is the place those things should be overriden. You can use '--host' and '--port' options (can make it part of your npm dev script) or HOST and PORT environment variables

nksaraf avatar Apr 08 '24 22:04 nksaraf

It would be convenient to have the options on the start command as well

birkskyum avatar Apr 09 '24 15:04 birkskyum