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.

Ressources included in CSS with a relative path are broken

See original GitHub issue

Versions

cli 6.0.0-rc.5

Repro steps

  • Create a new projet with last RC
  • In src/style.css, include a ressource with a relative path, like a font:
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: local('Material Icons'),
       local('MaterialIcons-Regular'),
       url(fonts/material-icons.woff2) format('woff2');
}

Observed behavior

If the ressource is small, it’s inlined with data: so it works. If the ressource is big, the path is transformed to an URL relative to the current location, so:

  • if you go in the app from the domain (/), it works (URL will be http://www.example.com/material-icons.woff2)
  • but if you go directly in some page of the app (like /page/2), it fails (URL will be http://www.example.com/page/material-icons.woff2)

Desired behavior

Should work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
clydincommented, Apr 19, 2018

@cyrilletuzi many of those options are now available on master. Unfortunately, not the one in question here.

However, a fix has been provided to workaround the underlying issue in the style-loader dependency with PR angular/devkit#743 and should be in the next release.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GWT ClientBundle CSS doesn't use relative paths to reference ...
GWT ClientBundle CSS doesn't use relative paths to reference images · Project Structure. I define a resource interface like this: · Resource Interface....
Read more >
Fixing Broken Relative Links on GitHub Pages | Pluralsight
Look for the resource at company.github.io/static/css/styles.css when you test on GitHub Pages. This is the incorrect resource location. As ...
Read more >
Links and Cross References | DocFX website - NET
In DocFX, you can link to a file using its relative path in the source directory. ... If you use file include to...
Read more >
An elegant solution of deploying React app into a subdirectory
This is an alternative solution that will help you to deploy your react app into subfolder utilizing native html capabilities.
Read more >
What is a URL? - Learn web development | MDN
Such resources can be an HTML page, a CSS document, an image, etc. ... a path like this represented a physical file location...
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