twig-html-loader icon indicating copy to clipboard operation
twig-html-loader copied to clipboard

Error then using async function and filters

Open devalexqt opened this issue 3 years ago • 0 comments

Then I try to add async function, for example:

functions:{
   getFileInfo:(value,...args)=>{
      return new Promise((resolve,reject)=>{
          setTimeout(()=>{
              // get file info from DB
               return resolve(JSON.stringify(require("./demo_data/file_data.js")))//info about file
            },3000)
       })//promise
   },//getFileInfo
}

I got error:

NonErrorEmittedError: (Emitted value instead of an instance of Error) TwigException: You are using Twig.js in sync mode in combination with async extensions.

devalexqt avatar Oct 27 '20 12:10 devalexqt