Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

481
Views
npm 'sass' package compile empty file in watch mode

I use the npm sass library to compile my ".scss" file and it works really well without any problem but in watch mode, after some file save it starts to produce an empty file. I restart the app and it compiles successfully again. my watch file is at this link: sass builder file I don't know if this is my watcher problem or sass problem or even windows file system problem. can anyone check to help me to fix this problem?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I try many ways to fix this issue and I found the problem is the Windows file system. in the windows file system if I save a file for a short moment depend on your system performance the file get empty and refill again so to fix this issue I add the setTimeout function in watch mode about 500ms so when user save scss file and we detect change first we wait 500ms then execute build function.

//before
 if (fileName && event == "change") {
   this.buildSassFile(fileConfig);            
 }
//after
 if (fileName && event == "change") {
   setTimeout(()=>{
     this.buildSassFile(fileConfig);
   },300);
                
 }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!