Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Lazy-loaded routes crash firebase cloud function #1810

@inorganik

Description

@inorganik

🐞 Bug report

What modules are related to this issue?

  • aspnetcore-engine
  • builders
  • common
  • express-engine
  • hapi-engine

Is this a regression?

Yes, I had this working in Angular 7 and @ng-universal/express 7

Description

My project builds and serves fine with npm run serve:ssr, but when served with firebase serve, I get a route match error on lazy-loaded routes that are directly requested from the server (e.g., refresh page on a lazy-loaded route). I have debated about where to post this, but I'm fairly certain it's a universal config issue.

🔬 Minimal Reproduction

Clone this minimal reproduction repo, make sure you clone the "firebase" branch.

🔥 Exception or Error


ERROR { Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'ssr-demo-b3ef3/us-central1/ssr'
>  Error: Cannot match any routes. URL Segment: 'ssr-demo-b3ef3/us-central1/ssr'
>      at router_ApplyRedirects.noMatchError (/Users/jamieperkins/Web-projects/GitHub/ngx-countup-with-ssr/functions/dist/webpack/server.js:149267:16)
>      at catchError_CatchSubscriber.urlTrees$.pipe.catchError [as selector] (/Users/jamieperkins/Web-projects/GitHub/ngx-countup-with-ssr/functions/dist/webpack/server.js:149231:28)

🌍 Your Environment


Package                                    Version
--------------------------------------------------------------------
@angular-devkit/architect                  0.900.7
@angular-devkit/build-angular              0.803.24
@angular-devkit/build-optimizer            0.803.24
@angular-devkit/build-webpack              0.803.24
@angular-devkit/core                       8.3.24
@angular-devkit/schematics                 8.3.24
@angular/cli                               8.3.24
@angular/fire                              5.4.2
@ngtools/webpack                           8.3.24
@nguniversal/express-engine                v8.2.6
@nguniversal/module-map-ngfactory-loader   v8.2.6
@schematics/angular                        8.3.24
@schematics/update                         0.803.24
rxjs                                       6.4.0
typescript                                 3.5.3
webpack                                    4.39.2
node                                     10.22

Related: firebase/firebase-tools#1890

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions