Pluggable Widget Development Error: fs is imported by fs?commonjs-external, but could not be resolved – treating it as an external dependency

0
Hi everyone, I am trying to use few node modules like “node-7z” ,”7z-bin” to extract one zip file into a folder. I have tried with pure node.js app then it was working fine. the same thing i have followed in our custom widget from visual studio code . I have created one js file having extraction code and I am calling that function from my jsx file. while executing npm run build ( building the widget) It shows some errors as follows Error: 'fs' is imported by  fs?commonjs-external, but could not be resolved – treating it as an external dependency . But in node.js app its not shown. Even i have installed “fs” node module again the same error populating.  Anyone know what is the cause and how to fix this issue please give your valuable solution. This is my js code, var zz=require("node-7z"); var sev=require("7zip-bin"); var testFun = function () {    const pathTo7zip = sev.path7za    const seven = zz.extractFull('D:/Vijayakumar/works/test extraction/text-box-sample-master.zip', 'D:/Vijayakumar/works/test extraction/out', {                    $bin: pathTo7zip     })   }; module.exports = testFun;   Thanks…!
asked
0 answers