Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

483
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda