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

fix(gatsby-plugin-manifest): Only reassign start_url if it already exists #21012

Merged
merged 2 commits into from
Jan 29, 2020
Merged

fix(gatsby-plugin-manifest): Only reassign start_url if it already exists #21012

merged 2 commits into from
Jan 29, 2020

Conversation

trevorblades
Copy link
Contributor

Currently, I'm seeing the following error coming from gatsby-plugin-manifest when I'm using only the icon option:

The "path" argument must be of type string. Received type undefined

This happens because the start_url option is undefined unless set by the user, yet we're passing it as an argument to path.posix.join, which expects each argument to be a string. This change adds a condition around the line reassigning manifest.start_url to make sure it exists first.

Currently, I'm seeing the following error coming from `gatsby-plugin-manifest` when I'm using only the `icon` option:

```
The "path" argument must be of type string. Received type undefined
```

This happens because the `start_url` option is undefined unless set by the user, yet we're passing it as an argument to `path.posix.join`, which expects each argument to be a string. This change adds a condition around the line reassigning `manifest.start_url` to make sure it exists first.
@trevorblades trevorblades requested a review from a team as a code owner January 29, 2020 20:45
@pieh pieh changed the title [gatsby-plugin-manifest] Only reassign start_url if it already exists fix(gatsby-plugin-manifest): Only reassign start_url if it already exists Jan 29, 2020
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worthy sanity check! Thanks @trevorblades

@pieh pieh added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jan 29, 2020
@gatsbybot gatsbybot merged commit dd96604 into gatsbyjs:master Jan 29, 2020
@trevorblades trevorblades deleted the guard-undefined-starturl branch January 29, 2020 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants