PlaceMe-SAS / single-spa-angular-cli-examples

MIT License
25 stars 15 forks source link

uncommenting SingleSpaModule #18

Open chr1soscl opened 6 years ago

chr1soscl commented 6 years ago

Hi, so I downloaded your project and I tried following the instructions provided, it built, it starts, but then the external application for help or app1 do not redirect, so I proceeded to uncomment the SingleSpaModule in the app.module.ts, but then when I start the server and try to open the page, I get the error:

zone.js:672 Unhandled Promise rejection: e is not a constructor ; Zone: ; Task: Promise.then ; Value: TypeError: 'home' died in status NOT_MOUNTED: e is not a constructor.

Have not found any useful information online about this.

robinComa commented 6 years ago

Hello, do you read this?

chr1soscl commented 6 years ago

Hello, do you read this?

Thank you very much, with the suggested changes it works, I tried to create my own application and hook it with the steps provided, but when hitting my new link I get a big exception, wondering how it is different to your implementation of app1, still researching.

Uncaught TypeError: Cannot read property 'bind' of undefined at runtime.ec2944dd8b20ec099bf3.js:1 at runtime.ec2944dd8b20ec099bf3.js:1 (anonymous) @ runtime.ec2944dd8b20ec099bf3.js:1 (anonymous) @ runtime.ec2944dd8b20ec099bf3.js:1 polyfills.65f5335c28e3321dca86.js:1 Uncaught TypeError: (intermediate value)(intermediate value).push is not a function at polyfills.65f5335c28e3321dca86.js:1 (anonymous) @ polyfills.65f5335c28e3321dca86.js:1 single-spa.js:1 Bootstrapping app 'patient' did not resolve or reject within 1000 milliseconds u @ single-spa.js:1 (anonymous) @ single-spa.js:1 ZoneDelegate.invokeTask @ zone.js:421 onInvokeTask @ vendor.3b5403353110262d564b.bundle.js:1 ZoneDelegate.invokeTask @ zone.js:420 ... main.222367095b161440301b.js:1 Uncaught TypeError: (intermediate value)(intermediate value).push is not a function at main.222367095b161440301b.js:1 (anonymous) @ main.222367095b161440301b.js:1 index.js:149 Cannot mount patient because that is not bootstraped (anonymous) @ index.js:149 ZoneAwarePromise @ zone.js:875 ... vendor.3b5403353110262d564b.bundle.js:1 ERROR Error: Uncaught (in promise): [object Undefined] at resolvePromise (zone.js:809) at zone.js:728 at single-spa.js:1 at ZoneDelegate.invoke (zone.js:388) at Object.onInvoke (VM645 vendor.3b5403353110262d564b.bundle.js:1) at ZoneDelegate.invoke (zone.js:387) at Zone.run (zone.js:138) at zone.js:858 at ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (VM645 vendor.3b5403353110262d564b.bundle.js:1) ... single-spa.js:1 While NOT_MOUNTED, 'patient' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate. u @ single-spa.js:1 r @ single-spa.js:1 (anonymous) @ single-spa.js:1 ... vendor.3b5403353110262d564b.bundle.js:1 ERROR Error: 'patient' died in status NOT_MOUNTED: undefined at u (single-spa.js:1) at r (single-spa.js:1) at single-spa.js:1 at r (single-spa.js:1) at Generator._invoke (single-spa.js:1) at Generator.t.(:8080/home/anonymous function) [as throw] (http://localhost:8080/build/common.js:12913:33512) at r (single-spa.js:1) at single-spa.js:1 at ZoneDelegate.invoke (zone.js:388) at Object.onInvoke (VM645 vendor.3b5403353110262d564b.bundle.js:1) kt @ vendor.3b5403353110262d564b.bundle.js:1 t.handleError @ vendor.3b5403353110262d564b.bundle.js:1 next @ vendor.3b5403353110262d564b.bundle.js:1 e.object.i @ vendor.3b5403353110262d564b.bundle.js:1 ...

chr1soscl commented 6 years ago

Something else I noticed is that when creating projects with the latest AngularCLI, I have to install inside the new project the single-spa-angular-cli library again, otherwise I get this error:

ERROR in C:/Users/myUser/code/single-spa/node_modules/single-spa-angular-cli/lib/platform/index.js Module not found: Error: Can't resolve 'rxjs/Observable' in 'C:\Users\myUser\code\single-spa\node_modules\single-spa-angular-cli\lib\platform'

kgamalseif commented 5 years ago

@chr1soscl @robinComa Do you find a solution for the above exceptions, as I encountered them when trying to add my own angular 6 CLI app?

Appreciate your support...

chr1soscl commented 5 years ago

@kgamalseif so what I did to be able to use these projects, I downloaded the whole project again and took the shell of an empty project, I renamed any line including the project name to my own and I build that new project, then I was able to create my own projects.