I am implementing single-spa(for micro front end) in existing project which is in angular 8. Installed single-spa in app1 using command "ng add single-spa-angular" and in root app I am importing and registering this app, but getting error like "
Uncaught app1: Application 'app1' died in status LOADING_SOURCE_CODE: "does not export an unmount function or array of functions
" searched it error on google but still not able to resolve. Please help
What I have tried:
<pre> <script type="systemjs-importmap">
{
"imports": {
"app1": "http://localhost:4200/main.js",
"single-spa": "https://cdnjs.cloudflare.com/ajax/libs/single-spa/4.3.5/system/single-spa.min.js"
}
}
<script>
System.import('single-spa').then(function (singleSpa) {
singleSpa.registerApplication(
'app1',
function () {
return System.import('app1');
},
function (location) {
return true;
}
);
singleSpa.start();
})
In angular.json using builder as:
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
}
}
in package.json done changes like
"start": "concurrently \"npm run start:server\" \"npm run serve:single-spa\"",