You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform:
Windows 11 Home - Version 10.0.22631 Build 22631
Test case
Attempting to deploy built public / dist folder for firebase hosting including files within subdirectories leads to incorrect path handling on Windows.
Steps to reproduce
Update to firebase-tools version 13.11.3 or newer on a Windows PC.
Run a deploy like "firebase deploy --only hosting --debug" that accesses files in subdirectories.
Notice in deploy debug log that file paths use incorrect path separators (\\ instead of /).
Expected behavior
Files should be handled correctly across all platforms with the correct path separators. For example, file paths should consistently use forward slashes (/) instead of (double) backslashes (\\).
Actual behavior
When deploying files or accessing files in subdirectories, firebase-tools generates paths with backslashes (\\) instead of forward slashes (/). This leads to correct upload but wrong file paths. In this case my "rewrites" config is forced to deliver "index.html" instead of wanted files.
For example:
Expected path: /fonts/CircularStd-Medium.otf
Actual path generated: /fonts\\CircularStd-Medium.otf
Observations / Solution
This issue only arises in firebase-tools version 13.11.3 and above. The problem seems to be related to the update of the glob package used within firebase-tools. Because glob@^7.1.2 (deprecated) was updated in [email protected] to glob@^10.4.1 in [email protected] and above. Already tested on MacOS there are no path issues.
Setting posix: true in firebase-tools listFiles configuration fixes this issue in my case, suggesting a regression in the latest versions. The issue occurs when there are subdirectories with nested files; paths at root level (/public or /dist) are formatted correctly, but paths in deeper directories are not.
I wanted to share this solution to prevent others from encountering the same issue and spending extensive time debugging, as I did. There's currently limited information available online about this problem, so I hope this report will assist others in quickly resolving similar issues.
The text was updated successfully, but these errors were encountered:
Environment info
firebase-tools:
>= 13.11.3
Platform:
Windows 11 Home - Version 10.0.22631 Build 22631
Test case
Attempting to deploy built public / dist folder for firebase hosting including files within subdirectories leads to incorrect path handling on Windows.
Steps to reproduce
13.11.3
or newer on a Windows PC.\\
instead of/
).Expected behavior
Files should be handled correctly across all platforms with the correct path separators. For example, file paths should consistently use forward slashes (
/
) instead of (double) backslashes (\\
).Actual behavior
When deploying files or accessing files in subdirectories, firebase-tools generates paths with backslashes (
\\
) instead of forward slashes (/
). This leads to correct upload but wrong file paths. In this case my "rewrites" config is forced to deliver "index.html" instead of wanted files.For example:
/fonts/CircularStd-Medium.otf
/fonts\\CircularStd-Medium.otf
Observations / Solution
This issue only arises in firebase-tools version
13.11.3
and above. The problem seems to be related to the update of theglob
package used within firebase-tools. Becauseglob@^7.1.2
(deprecated) was updated in[email protected]
toglob@^10.4.1
in[email protected]
and above. Already tested on MacOS there are no path issues.Setting
posix: true
in firebase-toolslistFiles
configuration fixes this issue in my case, suggesting a regression in the latest versions. The issue occurs when there are subdirectories with nested files; paths at root level (/public
or/dist
) are formatted correctly, but paths in deeper directories are not.I wanted to share this solution to prevent others from encountering the same issue and spending extensive time debugging, as I did. There's currently limited information available online about this problem, so I hope this report will assist others in quickly resolving similar issues.
The text was updated successfully, but these errors were encountered: