Describe the bug or question
I'm using single-spa (v6.0.3) as a root config to import a simple Angular 18 microfrontend that uses standalone components (no NgModule). After running the Angular schematic (ng add single-spa-angular) and adjusting for standalone components, I can build and serve the Angular app, and the root-config serves the import map. However when I visit the root-config (http://localhost:9000) I get:
$37: Invalid application - no unmount function
To Reproduce
Repo: https://github.com/ShawnM1/single-spa-playground
Start the Angular MFE dev server
cd angular-mfe
npm run serve:single-spa:angular-mfe
(serves at http://localhost:4200)
Start the root-config dev server
cd root-config
npm start
(serves at http://localhost:9000)
Open http://localhost:9000 in the browser.
Files / snippets used in my setup:
- root-config import map (index.ejs, local section)
{
"imports": {
"@app/root-config": "//localhost:9000/app-root-config.js",
"@angular-demo": "//localhost:4200/main.js"
}
}
const lifecycles = singleSpaAngular({
bootstrapFunction: singleSpaProps => {
singleSpaPropsSubject.next(singleSpaProps);
return bootstrapApplication(AppComponent, appConfig);
},
template: '<app-root />',
NgZone,
});
export const bootstrap = lifecycles.bootstrap;
export const mount = lifecycles.mount;
export const unmount = lifecycles.unmount;
Expected behavior
single-spa should import the microfrontend, find the exported lifecycle functions (bootstrap, mount, unmount), and mount the Angular app successfully. No #37: Invalid application - no unmount function error.
Screenshots and/or console output
If applicable, add screenshots or console output to help explain your problem.
Additional context
- single-spa root-config: v6.0.3
- angular: 18.2.0, using standalone components (no NgModule)
- single-spa-angular: ^9.2.0
- zone.js: ~0.14.10
- Repo: Repo: https://github.com/ShawnM1/single-spa-playground — root-config and angular-mfe are included there.
Describe the bug or question
I'm using single-spa (v6.0.3) as a root config to import a simple Angular 18 microfrontend that uses standalone components (no NgModule). After running the Angular schematic (ng add single-spa-angular) and adjusting for standalone components, I can build and serve the Angular app, and the root-config serves the import map. However when I visit the root-config (http://localhost:9000) I get:
$37: Invalid application - no unmount functionTo Reproduce
Repo: https://github.com/ShawnM1/single-spa-playground
Start the Angular MFE dev server
cd angular-mfe
npm run serve:single-spa:angular-mfe
(serves at http://localhost:4200)
Start the root-config dev server
cd root-config
npm start
(serves at http://localhost:9000)
Open http://localhost:9000 in the browser.
Files / snippets used in my setup:
Expected behavior
single-spa should import the microfrontend, find the exported lifecycle functions (bootstrap, mount, unmount), and mount the Angular app successfully. No
#37: Invalid application - no unmount functionerror.Screenshots and/or console output
If applicable, add screenshots or console output to help explain your problem.
Additional context