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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server.host with ipv6 does not work correctly #11466

Closed
7 tasks done
T1p0un3t opened this issue Dec 22, 2022 · 0 comments · Fixed by #11509
Closed
7 tasks done

server.host with ipv6 does not work correctly #11466

T1p0un3t opened this issue Dec 22, 2022 · 0 comments · Fixed by #11509
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@T1p0un3t
Copy link

Describe the bug

Hello,

i'm using vite with laravel 9.19 and laravel vite plugin (^0.7.0)

When i configure server.host with ipv6 (see reproduce) the final host does not contains [ ] aroud ip.
But i'ts works if ip is ::1

Generated http://2a00:1450:4007:81a::2003:5173/ instead of http://[2a00:1450:4007:81a::2003]:5173/

if i manualy change change url in my web page the ressource are loaded.

Reproduction

https://stackblitz.com/edit/vitejs-vite-pfb842?file=vite.config.js

Steps to reproduce

vite.config.js

export default defineConfig({
    plugins: [
        laravel({
            input: ["resources/css/app.scss", "resources/js/app.js"],
            refresh: true,

        }),
    ],
    build: {
        reportCompressedSize: false,
    },
    server: {
        host: '2a00:1450:4007:81a::2003'
    },
});

starting message

vite

VITE v3.2.5 ready in 1126 ms

➜ Local: http://2a00:1450:4007:81a::2003:5173/
➜ Network: http://192.168.0.41:5173/
the « local » url are used in web page. for example  http://2a00:1450:4007:81a::2003:5173/@vite/client (ko).

The expected url is : http://[2a00:1450:4007:81a::2003]:5173/@vite/client

I'ts works with « ::1 »

server: {
    host: '::1'
},

I have
17:03:37 [vite] server restarted.

➜ Local: http://[::1]:5173/

System Info

npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers

  System:
    OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (4) arm64 Cortex-A72
    Memory: 5.30 GB / 7.63 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 18.12.1 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Dec 23, 2022
sun0day pushed a commit to sun0day/vite that referenced this issue Dec 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants