Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong filenames for manifest.json #723

Closed
almeric opened this issue Oct 25, 2021 · 2 comments · Fixed by #735
Closed

Wrong filenames for manifest.json #723

almeric opened this issue Oct 25, 2021 · 2 comments · Fixed by #735
Labels
bug Something isn't working released

Comments

@almeric
Copy link

almeric commented Oct 25, 2021

Describe the bug
The filenames for the icons in the generated manifest file are not generated & will result in a 404 not found.

To Reproduce
When running as a module with the following config:

const { savedImages, htmlMeta, manifestJsonContent } = await pwaAssetGenerator.generateImages(
    './src/images/favicon/favicon_src.svg',
    './public/assets/images/favicon/',
    {
      scrape: false,
      favicon: true,
      mstile: true,
      portraitOnly: true,
      background: '#ffffff',
      type: 'png',
      pathOverride: '/assets/images/favicon',
      manifest: './public/manifest.json',
      log: false,
    }
  );

The following icons/splash images are generated:

apple-icon-180.png
apple-splash-640-1136.png
apple-splash-750-1334.png
apple-splash-828-1792.png
apple-splash-1125-2436.png
apple-splash-1170-2532.png
apple-splash-1242-2208.png
apple-splash-1242-2688.png
apple-splash-1284-2778.png
apple-splash-1536-2048.png
apple-splash-1620-2160.png
apple-splash-1668-2224.png
apple-splash-1668-2388.png
apple-splash-2048-2732.png
favicon-196.png
manifest-icon-192.maskable.png
manifest-icon-512.maskable.png
mstile-icon-128.png
mstile-icon-270.png
mstile-icon-558.png
mstile-icon-558-270.png

...but the following manifest data is generated:

[
  {
    src: '/assets/images/favicon/manifest-icon-192.png',
    sizes: '192x192',
    type: 'image/png',
    purpose: 'maskable'
  },
  {
    src: '/assets/images/favicon/manifest-icon-512.png',
    sizes: '512x512',
    type: 'image/png',
    purpose: 'maskable'
  }
]

As you can see above, manifest-icon-192.png & manifest-icon-512.png don't exist. manifest-icon-512.maskable.png & manifest-icon-512.maskable.png do exist however.

Expected behavior
The correct filenames are used in the generated manifest file.

System (please complete the following information):

  • OS: macOS 11.6
  • node version: v16.11.1
  • npm version: 8.0.0
  • pwa-asset-generator version: 5.0.0
@almeric almeric added bug Something isn't working needs verification Bug needs to be verified with reproduction labels Oct 25, 2021
@onderceylan onderceylan removed the needs verification Bug needs to be verified with reproduction label Nov 7, 2021
@onderceylan
Copy link
Collaborator

Hey @almeric, thanks for reporting the issue. I've reproduced the same. The issue seems to be related to the pathOverride option conflict. I'm working on a fix.

onderceylan added a commit that referenced this issue Nov 7, 2021
When 'pathOverride' option is used, the file name in the manifest entry was not reflecting the image
file name generated.

fix #723
@onderceylan onderceylan mentioned this issue Nov 7, 2021
onderceylan added a commit that referenced this issue Nov 7, 2021
When 'pathOverride' option is used, the file name in the manifest entry was not reflecting the image
file name generated.

fix #723
onderceylan pushed a commit that referenced this issue Nov 7, 2021
# [6.0.0](v5.0.1...v6.0.0) (2021-11-07)

### Bug Fixes

* **main:** add both 'any' and 'maskable' icons to manifest by default ([d7b488d](d7b488d)), closes [#725](#725)
* **main:** fix wrong icons file name when 'pathOverride' option is used ([25cef00](25cef00)), closes [#723](#723)

### BREAKING CHANGES

* **main:** In addition to 2 icons with `maskable` purpose in the manifest file, 2 more icon
entries of the same icons with `any` purpose is added to the manifest output.
@onderceylan
Copy link
Collaborator

🎉 This issue has been resolved in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants