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
Switching branches while sass --watch is running causes a Error: Can't find stylesheet to import. error when the switch causes one of the dependent files to be removed even if at the same time other files are changed so that the removed file is no longer needed after the branch switch.
I just noticed that the error does not happen when I close my IDE (Webstorm) and run sass from iterm2 instead of my IDE's built in terminal. Is it possible that my IDE is interfering with the watch mode?
My teammates who use a different IDE (VSCode) experience the same issue.
Unfortunately, we're fairly constrained here by the information provided by the operating system's filesystem watching API and the way that information is interpreted by the watcher library we use (in this case chokidar). Having implemented a watcher library in the past, I can say that the MacOS watcher API is particularly finicky, often reporting information that's incomplete, contradictory, or out-of-order.
The best workaround I can offer is passing --poll, which will skip the OS-level filesystem watcher entirely in favor of manually checking for new files every second. It won't be as efficient, but it'll be more likely to be robust in the face of whatever filesystem shenanigans Git is pulling.
Having a similar issue in a WSL/ubuntu/docker dev environment. When switching branches it compiles the CSS for the branch I'm switching from not the branch I'm switching into. A bit annoying but for now I just have to stop the watcher before switching branches or revert the changes..
Seem like chokidar has a major update coming soon, maybe it will fix this?
Switching branches while
sass --watch
is running causes aError: Can't find stylesheet to import.
error when the switch causes one of the dependent files to be removed even if at the same time other files are changed so that the removed file is no longer needed after the branch switch.Reproduction
Here's a reproduction repository: https://github.com/angelikatyborska/sass-watch-bug
To reproduce the bug, follow those steps:
main
branchnpm install
main
by runningnpm run build:scss
apple
branch. It contains an extra file that's also@use
'd from the input scss filein.scss
.apple
by runningnpm run build:scss
npm run build:scss:watch
main
branch while sass is running in watch modeError: Can't find stylesheet to import.
Video demo
screen-recording.mp4
Dependency versions
Please let me know if the reproduction steps and repo are clear and what other details you need to debug this 🙂
The text was updated successfully, but these errors were encountered: