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

After Build Error When Serving index.html ( Windows ) #68

Closed
bekalshenoy opened this issue May 7, 2020 · 1 comment
Closed

After Build Error When Serving index.html ( Windows ) #68

bekalshenoy opened this issue May 7, 2020 · 1 comment

Comments

@bekalshenoy
Copy link
Contributor

bekalshenoy commented May 7, 2020

Describe the bug

After Building App I Tried To Serve index.html But It Fail Due To Windows Path Problem.

index.html

<link rel="stylesheet" href="/assets/style.css">
<div id="app"></div>


<script type="module" src="/assets/index.js"></script>

I Tried To Fix It. Both Of This Are Solution Of This Bug.

<link rel="stylesheet" href="assets/style.css">
<div id="app"></div>


<script type="module" src="assets/index.js"></script>
----------------------------------------------------------------------------------------
<link rel="stylesheet" href="./assets/style.css">
<div id="app"></div>


<script type="module" src="./assets/index.js"></script>

I Added A PR(#63) To Fix This But It Was Rejected

System Info

  • vite version: 0.11.3
  • Operating System: Windows 10
  • Node version: 14.2
@bekalshenoy bekalshenoy added the bug label May 7, 2020
@yyx990803
Copy link
Member

This is not a Windows path problem, the generated asset paths are intentionally always absolute paths so that it can work when deployed to a server with SPA index fallback. You need to serve the dist folder with an http server.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants