Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
handleUnknownRoute using a subdirectory with Scully

In my Angular project I am using the following command to build the Angular project:

ng build --base-href='/mysubfolder/'

mysubfolder is the path from where the Angular site will be served i.e https:/myotherdomain/mysubfolder

myotherdomain == some other site mysubfolder == site where Angular project will be served and deployed

ng build --base-href='/mysubfolder/' command will add the /mysubfolder/ text in base href tag of every page like this:

The site is working fine so far. The problem comes when I extend this application to use https://scully.io/ to prender the Angular app. When I use the following command to prender the app:

npx scully -- 

it complains for so many weird errors related handleUnknownRoute:

⚠ handleUnknownRoute: "/mysubfolder/runtime.1e1f2c39fa49cf1c.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/polyfills.f7e3195ab4ce45af.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/main.918200bb3d790082.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/scripts.c48a99ff2e89312c.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/styles.6869685dcbc594de.css", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/runtime.1e1f2c39fa49cf1c.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/polyfills.f7e3195ab4ce45af.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/runtime.1e1f2c39fa49cf1c.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/polyfills.f7e3195ab4ce45af.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/main.918200bb3d790082.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/scripts.c48a99ff2e89312c.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/styles.6869685dcbc594de.css", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/polyfills.f7e3195ab4ce45af.js", 404:""
  ⚠ handleUnknownRoute: "/mysubfolder/main.918200bb3d790082.js", 404:""

Scully fails to prerender ther app.

Can you share how to fix the part where I can prerender the app with Suclly having at the top?

Scully has no issues when I build the angular project with ng build command i.e without any sub directory, the issue comes only when I build the Angular project with ng build --base-href='/mysubfolder/' command.

Can you share which setting I am missng to let Scully pre render the Angular app with subdirectory serve?

How to overcome that handleUnknownRoute error?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you run Scully, it needs to serve your application. When you use the base-href option of the CLI, it will update the index.html, but the destination is still ./dist/myApp Which gets copied into the Scully server and will fail. (as there is no subfolder).

The easy solution is to use the scully-base-href-rewrite plugin, instead of the Angular CLI option.

Also, you can do some renaming of your dist-folder, but that is confusing at least.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!