Pluggable widget : factoryThrew Error: factoryThrew -- Loading module widgets/siemens/myfifthwidget/MyFifthWidget failed! Check script file for syntax errors.

0
Hi everyone, I am implementing a custom widget to update content in a text file. I have tried lot of approaches like fs, fs-extra . they are showing like “fs exported by fs?commonjs-external but cannot be resolved” . then I am trying to file-system. Now there is no error while building the widget. After paste it into our Mendix project widget folder, I was Run Locally to see the result. When I open a page which containing this custom widget , I am getting the error as below . Pls Guide me how to resolve this error. const { fs } = require("../../node_modules/file-system"); exports.myTest = () => { var stream = fs.WriteStream("D:/Vijayakumar/WriteFromCustomWidget.txt"); stream.once("open", function (fd) { stream.write("My first row\n"); stream.write("My second row\n"); stream.end(); }); }; factoryThrew Error: factoryThrew at d (http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:553) at http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:9535 at Me (http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:9644) at Me (http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:9280) at http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:9835 at Fe (http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:9702) at Be (http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:9774) at i (http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:10909) at HTMLScriptElement.<anonymous> (http://localhost:8081/mxclientsystem/mxui/mxui.js?637666153178475187:5:13143) Loading module widgets/siemens/myfifthwidget/MyFifthWidget failed! Check script file for syntax errors.
asked
0 answers