Skip to content

SASS sourcemaps not working #8656

Description

@mindplay-dk

Describe the bug

SASS sourcemaps don't seem to work correctly.

I've stripped down my project to a few SASS files for reproduction, removed all third-party plugins, etc.

Testing this repro should be as easy as npm ci && npm run dev, then open a browser, open devtools, and inspect any of the elements on screen.

As shown in the screenshot here, sourcemaps do not point to any of the included SASS files in the project - instead, everything points to line numbers in index.scss:

image

These line numbers do not exist - index.scss is only 6 lines of code.

Reproduction

https://github.com/mindplay-dk/vite-sass-sourcemap-bug

System Info

System:
    OS: Linux 5.10 Ubuntu 16.04.7 LTS (Xenial Xerus)
    CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
    Memory: 4.89 GB / 6.13 GB
    Container: Yes
    Shell: 4.3.48 - /bin/bash
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.4 - ~/.npm-global/bin/yarn
    npm: 8.5.5 - ~/.npm-global/bin/npm
  npmPackages:
    vite: ^2.9.12 => 2.9.12

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions