question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Base URL with custom protocol is prefixed with slash

See original GitHub issue

Describe the bug

After setting custom protocol, built dist files have a leading slash in path.

export default defineConfig({
  base: 'app://',
});

(my use-case for custom protocol is to load app in Electron).

Reproduction

https://stackblitz.com/edit/vitejs-vite-bu8uph?file=dist/index.html

System Info

Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE    
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD

Used Package Manager

yarn

Logs

No response

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
patak-devcommented, Jun 14, 2022

I think we should close this though, I prefer we get a real use case to justify changing the isExternal logic. Let’s wait til then.

0reactions
SnosMecommented, Jun 14, 2022

Turns out, I don’t need to change the base path at all. Really feel stupid for not trying this from the beginning (considering it’s the default setting). 😄 Using app:// was a workaround for something in Chromium or Electron or VueCLI and now (2 years later) is no longer needed.

So yeah, although I no longer affected by this, it’s still a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Forward slashes in http protocol declaration in URL
I tried entering URLs in to many browsers without the forward slashes and they all work e.g. http:www.web-dewd.com works in Chrome, Firefox, ...
Read more >
In a URL, what is // for? [closed] - Super User
The first slash separates the host name from the path. The last slash is the path. A web server can, if it wants...
Read more >
Jekyll's site.url and baseurl - Made Mistakes
Double forward slashes e.g., //minima/assets/style.css; Missing base URL due to not using relative_url filter, absolute_url filter, or {{ site.
Read more >
URL Pattern API - MDN Web Docs
In patterns that match against the pathname part of a URL, groups get an automatic slash ( / ) prefix added if the...
Read more >
Configure Hosting behavior | Firebase Hosting - Google
Serve a function or access a Cloud Run container from a Hosting URL. ... Specify custom domain path prefixes to use for Dynamic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found