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
I have been breaking my head over this for about a day.
Background image with relative url and variable inside imported scss file throws Circular error on Windows and stops the process.
On Codesandbox, the logo resolves to null, but does continue to work. Logo image should work however and does not.
Changing main.scss from
@import'variables';
body {
color: $dark;
background-image: url('../assets/img/logo.png');
}
to (removing two lines)
body {
background-image: url('../assets/img/logo.png');
}
and the background image works perfectly.
If changed to (remove background-image line)
@import'variables';
body {
color: $dark;
}
and the colors work.
So individually the variable colors and background image work, but together they don't...
Reverting Sass back to 1.26.5 does fix the issue and I think it has something to do with:
/// If passed, the [originalUrl] represents the URL that was canonicalized
/// into [canonicalUrl]. It's used to resolve a relative canonical URL, which
/// importers may return for legacy reasons.
But with Vite I think it has something to do with rewriting the url tag inside scss files.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Provide a description in this issue that describes the bug.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
This issue has been locked since it has been closed for more than 14 days.
If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.
Describe the bug
I have been breaking my head over this for about a day.
Background image with relative url and variable inside imported scss file throws Circular error on Windows and stops the process.
On Codesandbox, the logo resolves to
null
, but does continue to work. Logo image should work however and does not.Changing main.scss from
to (removing two lines)
and the background image works perfectly.
If changed to (remove background-image line)
and the colors work.
So individually the variable colors and background image work, but together they don't...
Reverting Sass back to 1.26.5 does fix the issue and I think it has something to do with:
But with Vite I think it has something to do with rewriting the url tag inside scss files.
Might have something to do with #3729
Reproduction
A Github repo to reproduce error: https://github.com/JohanManders/vite-sass-circular-error
A codesandbox link: https://codesandbox.io/s/eager-waterfall-gmoti
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: yarn (but npm has same error)
Logs
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: