Closed 3gwebtrain closed 2 years ago
@3gwebtrain , you started doing it right by building a demo. Here are some points:
@3gwebtrain This is a very old issue, but posting a fix here in case it helps someone else facing the same issue.
The above issue is occurring since you are using v4.x of single-spa-angular along with v8 of Angular. Technically, v4.x only supports v9-11 of Angular. For Angular v2-8, you need to use v3 of single-spa-angular. Source: https://single-spa.js.org/docs/ecosystem-angular/#angular-8
After downgrading to single-spa-angular v3.6.0, I was unable to find any systemJS-compatible bundle for single-spa-angular so that I could share that too as a dependency between my applications. So I cloned this repo and modified the rollup configuration to generate UMD bundles for single-spa-angular as follows:
rollup.config.js
package.json
This generated the following bundle:
I loaded this into my root module systemjs-importmap like this (i was running a local fileserver on port 7000):
Note that I have not put single-spa-angular/internal
in my importmap since this doesn't exist for v3 of single-spa-angular.
After doing all this, the above error went away, but I got a new error, this time from the compiler.js
file:
I spent a lot of time trying to solve this, but couldn't identify the root cause of this.
Meanwhile, since this error seemed to be coming from compiler.js
I thought it might be an interesting experiment to see if I get the same error even after I build my angular applications with AOT enabled (because compiler.js should not be needed at runtime if using AOT). The experiment succeeded and the error vanished completely when I used AOT.
@arturovt @joeldenning Any possibility of releasing an update for v3 with support for SystemJS-compatible bundles by default? Would be a great help. Happy to contribute a PR if it helps. Also, any ideas about why dependency sharing doesn't work without AOT in Angular 8? I was unable to debug it by myself.
I am trying to integrate the
angular8
dependencies. all most look fine. But getting an error it blocks to wokr.App package.json:
root ejs file:
here is the repo