I have installed a @{SourceModule}/{SubModule} and imported it in the App.js file in my React project.
The app is working as expected when using npm start. However running npm test fails with the following log:
FAIL src/App.test.js
● Test suite failed to run
ReferenceError: regeneratorRuntime is not defined
> 1 | import TestModule from "@{SourceModule}/{SubModule}";
| ^
at node_modules/@{SourceModule}/{SubModule}/dist/index.js:3628:46
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/index.js:3657:2)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/components/Timeline/index.js:10:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/components/TimelineEditor/Helpers.js:1:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/components/TimelineEditor/EventHub.js:3:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/widgets/Vec3Widget.js:5:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/components/PropertyRow.js:13:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/components/Component.js:4:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/components/ComponentsContainer.js:4:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/components/Sidebar.js:3:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/components/Main.js:6:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/src/index.js:16:1)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/index.js:29901:18)
at __webpack_require__ (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:19:1)
at node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/bootstrap 67aaffd607fcdcc03468:65:1
at node_modules/@{SourceModule}/{SubModule}/dist/index.js:79:10
at webpackUniversalModuleDefinition (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/universalModuleDefinition:3:1)
at Object.<anonymous> (node_modules/@{SourceModule}/{SubModule}/dist/webpack:/webpack/universalModuleDefinition:10:2)
at Object.<anonymous> (src/App.js:2:1)
at Object.<anonymous> (src/App.test.js:2:1)
I have tried installing and importing core-js/stable and regenerator-runtime in my app index.js (and not in the module), but it doesn't seem to help. Is this something I could solve from my side or I should apply this/any other solution to the module itself?