Skip to content

PWA icons are broken #25174

@christianliebel

Description

@christianliebel

Command

add

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

15.2.8

Description

Yesterday at a workshop, we used ng add @angular/pwa as usual to add PWA functionality to our app. Unfortunately, the app icons were broken (on all systems used, not only macOS).

Minimal Reproduction

  1. Run ng new foo
  2. Run cd foo
  3. Run ng add @angular/pwa
  4. Navigate to src/assets/icons

Exception or Error

The icons in src/assets/icons are broken, probably due to a bad encoding (see below).

Your Environment

Angular CLI: 16.0.0
Node: 16.18.1
Package Manager: npm 8.19.2
OS: darwin arm64

Angular: 16.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, pwa, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1600.0
@angular-devkit/build-angular   16.0.0
@angular-devkit/core            16.0.0
@angular-devkit/schematics      16.0.0
@schematics/angular             16.0.0
rxjs                            7.8.1
typescript                      5.0.4

NOTE: I installed the PWA package to create a diff of the icon files' contents.

Anything else relevant?

It looks like an encoding issue. The PNG files in the PWA schematics package work properly, but the generated files in the workspace are broken. Some values seem to have been replaced by EFBFBD (left - file moved to workspace, right - original file), so the file is much larger:

Screenshot 2023-05-09 at 08 10 14

I think this happens outside the scope of the actual PWA schematic (i.e., in the engine).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions