storefront-angular-starter icon indicating copy to clipboard operation
storefront-angular-starter copied to clipboard

serve ssr problem

Open sirramin opened this issue 4 years ago • 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)

sirramin avatar May 12 '20 16:05 sirramin

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.

phongnguyen6691 avatar Jul 27 '20 08:07 phongnguyen6691