Skip to content

Build under symbol/junction-linked directories will cause CSS missing #17319

Description

@Chaoses-Ib

Astro Info

Astro                    v7.0.6
Vite                     v8.1.3
Node                     v26.4.0
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When npm run build under a symbol/junction link of a Astro project, inline CSS and CSS files, together with CSS file links, will be missing, at least on Windows.

Reproduce PowerShell script:

npm create astro@latest -- --template portfolio
# Name the project 'test'

cd test
npm run build
mv dist dist-baseline

cd ..
# Junction, symlink works too but requires sudo
cmd /c mklink /J linked test
cd linked
npm run build

BaseLayout.*.css is missing:
Image

Inline CSS and CSS file link is missing:
Image

What's the expected result?

CSS works as normal.

Link to Minimal Reproducible Example

StackBlitz/Git doesn't support symlink (on Windows). See above script.

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)triage: fix pendingReporter needs to verify the triage bot fix works

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions