Skip to content

SVG loading issue with Angular v19 SSR #82

Description

@davidebilardello

Hi there!

I’m using your library in my Angular v19 SSR project and encountered an issue with SVG loading. I noticed the documentation mentions SSR compatibility problems, and I attempted to implement a custom SvgLoadStrategySsr as follows:

@Injectable()
export class SvgLoadStrategySsr implements SvgLoadStrategy {
  load(url: Observable<string>): Observable<string> {
    return url
  }

  config(url: string): Observable<string> {
    const iconPath = join(process.cwd(), 'dist', 'menu-app', 'browser', url);
    const iconSVG = readFileSync(iconPath, 'utf8');
    return of(iconSVG);
  }
}

However, I’m facing an issue where one of my custom logos is not rendering correctly. Here’s what I’m seeing:
Image

Expected Output:
Image

If you need additional details, such as the SVG file or more context, please let me know.

Thanks for your amazing work on this library!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions