Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

//index.html in root app which is not angular
<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\"",
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900