8000 Cannot activate host configuration from cli as Vite does · Issue #50 · bhbs/viject · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Cannot activate host configuration from cli as Vite does #50
Open
@rangzen

Description

@rangzen

Describe the bug
Once viject passed, can't activate listening on network with --host.

To Reproduce
Steps to reproduce the behavior:

  1. Create a CRA
  2. Run it, you can access through localhost and from the network (192.168.0.0/24)
  3. Run viject
  4. Can't access from the network

Steps to reproduce the behavior:

  1. Create a Vite app
  2. Run it, you can access through localhost and from the network (192.168.0.0/24)

Expected behavior
It seems that modifying vite.config.ts by adding server configuration in the defineConfig is not used. Same for --host variables from cli.

Workaround
In devServerPlugin, change host to host: HOST || '0.0.0.0', to have the default value as opened is working.
From the CLI, HOST='0.0.0.0' yarn dev is also working.

So, this is the normal behaviour with actual plugins, but if you check StackOverflow, Reddit, etc. some hints will not work. Maybe add some documentation or a comment in the vite.config.ts?

Anyway, awesome tool! Thank you!

366A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0