build(vite): fix assets directories with symlinks present#3359
Merged
ReenigneArcher merged 1 commit intoLizardByte:masterfrom Nov 2, 2024
Merged
build(vite): fix assets directories with symlinks present#3359ReenigneArcher merged 1 commit intoLizardByte:masterfrom
ReenigneArcher merged 1 commit intoLizardByte:masterfrom
Conversation
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 symlink
to the `~/Documents/git` directory. Further imagine that the user clones
Sunshine into `~/git/Sunshine`. In this setup, attempting to build
the web-ui will fail with a series of incredibly cryptic error messages,
which look like this:
RollupError: The "fileName" or "name" properties of emitted chunks
and assets must be strings that are neither absolute nor relative
paths, received "../../../../../../Documents/git/Sunshine/src_assets/common/assets/web/password.html".
This seems to occur because vite isn't aware that `Documents/git` and
`git` 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 one
canonical path, rather than two. This prevents the error when building.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3359 +/- ##
=======================================
Coverage 11.05% 11.05%
=======================================
Files 99 99
Lines 17231 17231
Branches 8034 8034
=======================================
Hits 1905 1905
Misses 12641 12641
Partials 2685 2685
Flags with carried forward coverage won't be shown. Click here to find out more. |
c2vi
pushed a commit
to c2vi/Sunshine
that referenced
this pull request
Mar 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
~/gitdirectory is a symlinkto the
~/Documents/gitdirectory. 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/gitandgitare actually the same directory as each other.To fix the problem, this commit resolves the symlinks (if any) in
vite.config.jsso 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