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

gatsby-plugin-manifest omits asset prefix in manifest.webmanifest icon URLs #25207

Open
disintegrator opened this issue Jun 22, 2020 · 10 comments
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins type: bug An issue or pull request relating to a bug in Gatsby

Comments

@disintegrator
Copy link
Contributor

disintegrator commented Jun 22, 2020

Description

Currently, gatsby-plugin-manifest is prefixing the URL to the icons in manifest.webmanifest with the pathPrefix config value only. I would assume, like other assets, the icons in the manfiest should be prefixed with assetPrefix followed by pathPrefix. Weirdly though, the favicon and other app icons that are inserted the document's <head> are prefixed with assetPrefix and pathPrefix as expected so there's an inconsistency between icon URLs in gatsby's html document and ones inside manifest.webmanifest.

Steps to reproduce

See https://github.com/disintegrator/gatsby-25207

Expected result

  1. URL of icons added to the <head> of pages are prefixed with assetPrefix and then pathPrefix.
  2. URL of favicon and inside of manifest.webmanifest are prefixed with assetPrefix and then pathPrefix.

Actual result

✅ (working) URL of icons added to the <head> of pages are prefixed with assetPrefix and then pathPrefix.
❌ (not working) URL of favicon and inside of manifest.webmanifest are only prefixed with pathPrefix .

Environment

  System:
    OS: macOS 10.15.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Shell: 5.7.1 - /usr/local/bin/zsh
  Binaries:
    Node: 12.18.1 - /var/folders/11/zcvk9j4j7rd_dj0t5hcv9wc80000gp/T/yarn--1592842676680-0.26237458001029235/node
    Yarn: 1.22.4 - /var/folders/11/zcvk9j4j7rd_dj0t5hcv9wc80000gp/T/yarn--1592842676680-0.26237458001029235/yarn
    npm: 6.14.5 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 83.0.4103.106
    Firefox: 77.0.1
    Safari: 13.1.1
  npmPackages:
    gatsby: ^2.23.3 => 2.23.3
    gatsby-image: ^2.4.7 => 2.4.7
    gatsby-plugin-manifest: ^2.4.11 => 2.4.11
    gatsby-plugin-offline: ^3.2.9 => 3.2.9
    gatsby-plugin-react-helmet: ^3.3.4 => 3.3.4
    gatsby-plugin-sharp: ^2.6.11 => 2.6.11
    gatsby-source-filesystem: ^2.3.11 => 2.3.11
    gatsby-transformer-sharp: ^2.5.5 => 2.5.5
  npmGlobalPackages:
    gatsby-cli: 2.7.15
@disintegrator disintegrator added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 22, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 22, 2020
@madalynrose madalynrose added the topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins label Jun 23, 2020
@madalynrose
Copy link
Contributor

Thanks for letting us know about this issue, @disintegrator! I'm tagging @moonmeister in case he has context on this.

@madalynrose madalynrose removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 23, 2020
@moonmeister
Copy link
Contributor

I don't have any specific background, I remember working on this PR with core team but nothing specific that'd help. This probably just got over looked. I'll take a look at the repro when I get a chance.

@moonmeister
Copy link
Contributor

Here's the original PR: #20142

@wardpeet Looks like the you did most this work, basePath being used doesn't seem to be providing the asset prefix. Is there a way to fix this?

@ehannes
Copy link

ehannes commented Jul 9, 2020

Is there any difference between this issue and #18497? Was this not resolved in #20142?

@moonmeister
Copy link
Contributor

We fixed all pathPrefix related issues but the assetPrefix specifically is still not getting applied correctly inside the manifest file. It's a bug in the original fix.

@ehannes
Copy link

ehannes commented Jul 10, 2020

Ok. Then if someone more than me is wondering about this, #18497 was incorrectly closed since the problem I described there was concerning assetPrefix and not pathPrefix. Thanks @disintegrator for creating a new issue to keep this alive since the problem still exists.

@LekoArts LekoArts added help wanted Issue with a clear description that the community can help with. good first issue Issue that doesn't require previous experience with Gatsby status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. labels Jul 15, 2022
@Rupesh59
Copy link

Rupesh59 commented Jan 9, 2023

Description

Currently, gatsby-plugin-manifest is prefixing the URL to the icons in manifest.webmanifest with the pathPrefix config value only. I would assume, like other assets, the icons in the manfiest should be prefixed with assetPrefix followed by pathPrefix. Weirdly though, the favicon and other app icons that are inserted the document's <head> are prefixed with assetPrefix and pathPrefix as expected so there's an inconsistency between icon URLs in gatsby's html document and ones inside manifest.webmanifest.

Steps to reproduce

See https://github.com/disintegrator/gatsby-25207

Expected result

  1. URL of icons added to the <head> of pages are prefixed with assetPrefix and then pathPrefix.
  2. URL of favicon and inside of manifest.webmanifest are prefixed with assetPrefix and then pathPrefix.

Actual result

white_check_mark (working) URL of icons added to the <head> of pages are prefixed with assetPrefix and then pathPrefix. x (not working) URL of favicon and inside of manifest.webmanifest are only prefixed with pathPrefix .

Environment

  System:
    OS: macOS 10.15.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Shell: 5.7.1 - /usr/local/bin/zsh
  Binaries:
    Node: 12.18.1 - /var/folders/11/zcvk9j4j7rd_dj0t5hcv9wc80000gp/T/yarn--1592842676680-0.26237458001029235/node
    Yarn: 1.22.4 - /var/folders/11/zcvk9j4j7rd_dj0t5hcv9wc80000gp/T/yarn--1592842676680-0.26237458001029235/yarn
    npm: 6.14.5 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 83.0.4103.106
    Firefox: 77.0.1
    Safari: 13.1.1
  npmPackages:
    gatsby: ^2.23.3 => 2.23.3
    gatsby-image: ^2.4.7 => 2.4.7
    gatsby-plugin-manifest: ^2.4.11 => 2.4.11
    gatsby-plugin-offline: ^3.2.9 => 3.2.9
    gatsby-plugin-react-helmet: ^3.3.4 => 3.3.4
    gatsby-plugin-sharp: ^2.6.11 => 2.6.11
    gatsby-source-filesystem: ^2.3.11 => 2.3.11
    gatsby-transformer-sharp: ^2.5.5 => 2.5.5
  npmGlobalPackages:
    gatsby-cli: 2.7.15

Delete all logs file and reinstall again

@VardaQuraishi
Copy link

Is this issue resolved or can I work on it? @disintegrator @moonmeister @ehannes

@moonmeister
Copy link
Contributor

As far as i know it's unresolved and you're welcome to work on it.

@emmron

This comment has been minimized.

emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…pplied to URLs in manifest.webmanifest and HTML head.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…pplied to URLs in manifest.webmanifest and HTML head.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…est.webmanifest and HTML head. Ensured correct path handling and resolved linting issues by updating string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…est.webmanifest and HTML head. Ensured correct path handling and resolved linting issues by updating string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…est.webmanifest and HTML head. Ensured correct path handling and resolved linting issues by updating string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 12, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 13, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 13, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…pplied to URLs in manifest.webmanifest and HTML head.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…pplied to URLs in manifest.webmanifest and HTML head.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…est.webmanifest and HTML head. Ensured correct path handling and resolved linting issues by updating string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…est.webmanifest and HTML head. Ensured correct path handling and resolved linting issues by updating string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…est.webmanifest and HTML head. Ensured correct path handling and resolved linting issues by updating string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
emmron added a commit to emmron/gatsby-issue-25207-fix that referenced this issue Jul 22, 2024
…correctly applied to URLs in manifest.webmanifest and HTML head. Also, address linting issues by correcting string literals and formatting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby help wanted Issue with a clear description that the community can help with. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

9 participants