kit icon indicating copy to clipboard operation
kit copied to clipboard

`vite dev` should include `paths.base` in the "Local" url, or `paths.base` shouldn't be used by `vite.dev`

Open DetachHead opened this issue 3 years ago • 0 comments

Describe the problem

if i have paths.base specified, the url that vite dev outputs is incorrect:

// svelte.config.js
import adapter from '@sveltejs/adapter-node'

const config = {
    kit: {
        adapter: adapter(),
        paths: { base: '/foo' },
    },
}

export default config
3:08:37 pm [vite] server restarted.

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose 

when navigating to http://localhost:5173/ the following error is displayed:

Not found (did you mean /foo/?)

Describe the proposed solution

two possible solutions:

  1. include paths.base in the url outputted by vite dev (assuming it's possible to change)
  2. from my understanding, paths.base is only relevant on the deployment target, meaning there's no reason for vite dev to use it. if this is true, it would probably be better for vite dev to just ignore paths.base entirely

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

DetachHead avatar Dec 12 '22 05:12 DetachHead