问题
I want to make a website with scss but when i save the scss file it gives me an error. However, if I saved it a couple times then it will render completely. Its nothing major but it bugs me.
I tried finding an answer in Google but nothing works
This is just a simple scss file because I am just trying to check if there's an error before i begin my project. turns out there is.
@import "fixed";
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #444;
}
{
"status": 3,
"message": "File to read not found or unreadable: E:/Coding Stuff/Websites/bs4/scss/main.scss",
"formatted": "Internal Error: File to read not found or unreadable: E:/Coding Stuff/Websites/bs4/scss/main.scss\n"
}
after saving a few times then:
=> changed: E:\Coding Stuff\Websites\bs4\scss\main.scss
Rendering Complete, saving .css file...
Wrote CSS to E:\Coding Stuff\Websites\bs4\css\main.css
What did i do wrong? please help
回答1:
if you are using a node-sass as the compiler and vscode or sublime text AFAIK, the issue is with atomic save option where node-sass can't have access to transpile the scss file because the editor is still busy with it. Two ways of fixing this include:
- Replace render.js file of
node-sass
check here there is a drawback of having to do this everytime you install node-sass
Install
sass
module instead$ yarn add -D sass script
$ sass --watch input.scss output.css
来源:https://stackoverflow.com/questions/57705352/scss-rendering-error-internal-error-file-to-read-not-found-or-unreadable