push-based / ngx-fast-svg

📦 SVGs, fast and developer friendly in Angular
58 stars 5 forks source link

Doesn't work on localhost #60

Closed e-oz closed 1 year ago

e-oz commented 1 year ago

Angular's Express (ng serve) returns 304, not 200, and apparently, it breaks something - an icon is not rendered (completely empty). Only the suspense image is visible for a moment. The path to the icon is correct (and redirected response contains the SVG body). Angular 16.2

ChristopherPHolder commented 1 year ago

Hi @e-oz Can you please provided a reprodusable example or explain in more detail what you have tried?

e-oz commented 1 year ago

Sure: https://stackblitz.com/edit/stackblitz-starters-ltryjg?file=src%2Fmain.ts

ChristopherPHolder commented 1 year ago

Thanks @e-oz

https://stackblitz.com/edit/stackblitz-starters-sbufwp

So i have made the appropriate changes and is seems to be working :D

url: (name: string) =>path/to/svg-assets/${name}.svg`

And in your angular.json

"architect": {
  "build": {
    "options": {
      "assets": ["src/assets"],
     }
   }
}
e-oz commented 1 year ago

thank you, and sorry for wasting your time for nothing.