Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested SASS Partials Sourcemap No Longer Working #18957

Open
7 tasks done
Santana1053 opened this issue Dec 13, 2024 · 0 comments · May be fixed by #18971
Open
7 tasks done

Nested SASS Partials Sourcemap No Longer Working #18957

Santana1053 opened this issue Dec 13, 2024 · 0 comments · May be fixed by #18971
Labels
feat: sourcemap Sourcemap support p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@Santana1053
Copy link

Santana1053 commented Dec 13, 2024

Describe the bug

I have an pre- existing vite project that I am upgrading. Starting in Vite v5.3.5 and going up to the latest v6 release my sass partial files are not loading in the sourcemap, and dev tools only shows the initial imported file (styles.sass). If I revert back to v5.3.4 then my partial sass files are showing again.

I have looked through the changelog but I can't find any API changes that would resolve this issue.

Reproduction

https://stackblitz.com/edit/vitejs-vite-cicjj47e?file=src%2Fsass%2Fvendor%2Findex.scss%3AL98&terminal=dev

Steps to reproduce

npm install && npm run dev

Inspect the select2 element in the middle of the page. The sass selectors report the file as the primary imported file style.scss, when the real file that the styles are coming from is _select2.sass.

image

If you remove the @import 'select2'; line at src/sass/vendor/index.scss:98 then the partial file will change from style.scss (incorrect) to index.scss (correct).

Reverting to vite 5.3.4 also fixes the problem.

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (28) x64 Intel(R) Core(TM) i7-14700KF
    Memory: 28.84 GB / 63.83 GB
  Binaries:
    Node: 20.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    bun: 1.1.3 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red sapphi-red added p2-edge-case Bug, but has workaround or limited in scope (priority) feat: sourcemap Sourcemap support labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: sourcemap Sourcemap support p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants