vendure-ecommerce/storefront-angular-starter

serve ssr problem

Opened this issue · 1 comments

After building ssr version with "build:ssr" script I tried to run it with "serve:ssr" script
But it contains errors blow

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'runtime.64107a3829618e063f9a.js'
Error: Cannot match any routes. URL Segment: 'runtime.64107a3829618e063f9a.js' at ApplyRedirects.noMatchError (\storefront\dist\server\main.js:1:4180130)

Hi @sirramin

Vendure storefront supposes your base path is "https://yourhost.com/storefront", you either need to setup a redirect rule or override the base path as below:

  1. Open file src\environments\environment.prod.ts -> copy the content from the environment.ts to this file (or change according to your production environment)
  2. Remove the "/storefront" in all these files angular.json, src\app\app.module.ts, src\manifest.json

Delete the dust folder and build again then re-test.