Skip to content

[v6] Sass file resolution no longer respects "baseUrl" in tsconfig.json #15897

Description

@ashleigh-yeoman

Astro Info

## v6
Astro                    v6.0.4
Vite                     v7.3.1
Node                     v24.13.0
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

## v5
Astro                    v5.18.1
Vite                     v6.4.1
Node                     v24.13.0
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

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

No response

Describe the Bug

In Astro v5, a scss/sass file in the root of the src directory could be referenced by name only (e.g. @use "colors.scss";) if baseUrl in tsconfig.json was set to src

In Astro v6, this no longer works. Using --verbose when launching the dev server, I can see that v6 treats a bare filename as relative to the importer (e.g. src/components/Section.astro with @use "colors.scss"; results in trying to load src/components/colors.scss rather than src/colors.scss).

What's the expected result?

@use "colors.scss"; respects the baseUrl specified in tsconfig.json

Link to Minimal Reproducible Example

https://github.com/ashleigh-yeoman/astro-sass-bug-repro

Participation

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

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)pkg: astroRelated to the core `astro` package (scope)triage: fix rejectedReporter says the proposed fix does not work

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions