question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--deploy-url will have no effect on assets paths

See original GitHub issue

Please provide us with the following information:

Versions.

Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version and paste the result here: @angular/cli: 1.0.0-beta.30 node: 7.5.0 os: win32 x64 @angular/common: 2.4.6 @angular/compiler: 2.4.6 @angular/core: 2.4.6 @angular/forms: 2.4.6 @angular/http: 2.4.6 @angular/platform-browser: 2.4.6 @angular/platform-browser-dynamic: 2.4.6 @angular/router: 3.4.6 @angular/cli: 1.0.0-beta.30 @angular/compiler-cli: 2.4.6

Repro steps.

Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.

  • create app with the cli
  • use img src="assets/logo.png" in a template
  • ng build -d mysubfolder -bh mysubfolder copy the content of the dist to “htdocs/mysubfolder” on any webserver or use app.use('/mysubfolder', express.static(path.join(__dirname, angularDist))); on a node server.

The log given by the failure.

Normally this include a stack trace and some more information.

404 on all assets because it will ignore base href or deploy url and just use GET /assets/logo.png

Mention any other details that might be useful.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:53
  • Comments:44 (9 by maintainers)

github_iconTop GitHub Comments

40reactions
filipesilvacommented, Mar 13, 2017

@milankr we do not process HTML, so that is expected behaviour.

33reactions
tomasklingencommented, Apr 13, 2017

@filipesilva can you tell me what the reasoning was to only process asset urls in css, and not in the html templates?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular deploy-url assets path - Stack Overflow
I want to write an IIS rewrite rule that checks if a /assets/... path exists inside my deployment path and if so, rewrites...
Read more >
Angular --deploy-url and --base-href - The art of simplicity
If you deploy your Angular app to a subfolder, the '--base-href' is important to generate the correct routes. This parameter will update the ......
Read more >
Angular 10 -Deploy-Url Assets Path In Iis - ADocLib
Today I faced the problem where I had to use different base paths for router and static assets. Angular makes use of the...
Read more >
Angular 4: Use of base-href and deploy-url build options
Today, I faced the problem where I had to use different base paths for router and static assets. Angular makes use of the...
Read more >
Connecting an Angular Single Page Application (SPA) with ...
Angular CLI is based on webpack so some steps will be valid for other ... --base-href / --deploy-url your-uploads-path/assets/web-app/",.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found