"xml2js" files empty in node_modules kibana 7.6.0

I am developing a kibana app plugin and using xml2js module in it. When I am integrating it in release version of Kibana, it is failing as required node modules "xml2js" and its dependencies "xmlbuilder" and "sax" exists but files are empty. Files are there but content is empty and that is why its breaking.
eg.
kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\node_modules\xml2js\lib\builder.js
kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\node_modules\xml2js\lib\xml2.js

all the files are empty.

error:
error [07:42:35.906] TypeError: _xml2js.default.Builder is not a constructor at generatePayload (C:\Users\e00990\Desktop\kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\plugins\mdn_locate_plugin\server\routes/routes.js:203:21) at handler (C:\Users\e00990\Desktop\kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\plugins\mdn_locate_plugin\server\routes/routes.js:10:23) at module.exports.internals.Manager.execute (C:\Users\e00990\Desktop\kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\node_modules\hapi\lib\toolkit.js:35:106) at Object.internals.handler (C:\Users\e00990\Desktop\kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\node_modules\hapi\lib\handler.js:50:48) at exports.execute (C:\Users\e00990\Desktop\kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\node_modules\hapi\lib\handler.js:35:36) at Request._lifecycle (C:\Users\e00990\Desktop\kibana-7.6.0-windows-x86_64\kibana-7.6.0-windows-x86_64\node_modules\hapi\lib\request.js:263:62)

Is it a bug ? Is there any command that will update these packages with valid file content?

Note: I tried by replacing xml2js, xmlbuilder and sax modules with valid file contents and code worked but I do not want to manual update.

Did you add the modules in your package.json, if you're making a standalone plugin? Of if you're making the plugin in Kibana, you need to add it to the kibana package.json locally then and run yarn kbn bootstrap.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.