Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Vite server config is being ignored #1435

Open
2 tasks done
moonlitgrace opened this issue Apr 6, 2024 · 4 comments
Open
2 tasks done

[Bug?]: Vite server config is being ignored #1435

moonlitgrace opened this issue Apr 6, 2024 · 4 comments
Labels
bug Something isn't working vinxi related to vinxi

Comments

@moonlitgrace
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • 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

@moonlitgrace moonlitgrace added the bug Something isn't working label Apr 6, 2024
@atk
Copy link
Contributor

atk commented Apr 6, 2024

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

@ryansolid
Copy link
Member

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 ryansolid added the vinxi related to vinxi label Apr 8, 2024
@nksaraf
Copy link
Member

nksaraf commented Apr 8, 2024

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

@birkskyum
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vinxi related to vinxi
Projects
None yet
Development

No branches or pull requests

5 participants