i am trying to use single-spa to add another angular application to my container application.
As a template for this I have looked at this repo on GitHub.
Now the following problem occurs:
In the app-loading service the following line tries to load the application with systemjs and mount it via single-spa
mount(appName: string, domElement: HTMLElement): Observable<unknown> {
return from(System.import<ParcelConfig>(appName)).pipe(
tap((app: ParcelConfig) => {
this.loadedParcels[appName] = mountRootParcel(app, {
domElement
});
})
);
}
In the import-map overview you can also see that everything was imported correctly:
Image from import-map overview
When the module is loaded in Angular the following error is now displayed:
Error: Cannot find module 'child1'
at 6.js:1
at l.invoke (polyfills.js:1)
at Object.onInvoke (main.js:1)
at l.invoke (polyfills.js:1)
at a.run (polyfills.js:1)
at polyfills.js:1
at l.invokeTask (polyfills.js:1)
at Object.onInvokeTask (main.js:1)
at l.invokeTask (polyfills.js:1)
at a.runTask (polyfills.js:1)
However, when I want to load the external angular page in the javascript console via SystemJS it works and I get the single-spa lifecycle methods back correctly:
Command:
await System.import('child1');
Result:
Module {default: Module, __useDefault: true, bootstrap: ƒ, mount: ƒ, unmount: ƒ, …}
bootstrap: ƒ ()
default: Module {__esModule: true, Symbol(Symbol.toStringTag): "Module"}
mount: ƒ ()
unmount: ƒ ()
__esModule: true
__useDefault: true
Does anyone know what the problem is?