build(vite): fix assets directories with symlinks present #3359
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This commit addresses a situation where the user clones the Sunshine
directory in a location such that an ancestor of the repository is a
symlink. For example, imagine that the
~/git
directory is a symlinkto the
~/Documents/git
directory. Further imagine that the user clonesSunshine into
~/git/Sunshine
. In this setup, attempting to buildthe web-ui will fail with a series of incredibly cryptic error messages,
which look like this:
This seems to occur because vite isn't aware that
Documents/git
andgit
are actually the same directory as each other.To fix the problem, this commit resolves the symlinks (if any) in
vite.config.js
so that vite will only have to deal with onecanonical path, rather than two. This prevents the error when building.
Screenshot
N/A
Issues Fixed or Closed
N/A
Type of Change
.github/...
)Checklist