gatsby icon indicating copy to clipboard operation
gatsby copied to clipboard

Sitemap plugin errors are unhelpful

Open Mike-Dax opened this issue 2 years ago β€’ 1 comments

Preliminary Checks

  • [X] This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
  • [X] This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions

Description

image

https://github.com/gatsbyjs/gatsby/blob/0ef331d30eab0731457b6607c9320e2818eb1677/packages/gatsby-plugin-sitemap/src/internals.js#L179

This error is unhelpful, swallowing any information about what's actually happening.

Monkey patching the plugin to present the real error, it gives:

Make the page URI available at `path` or provide a custom `resolvePagePath` function.

Which is also unhelpful, given resolvePagePath is provided. I had provided a resolvePagePath function.

Steps to Reproduce

I was building a sitemap, and didn't have a path member in the page object.

Expected Result

Better error messages when things go wrong.

The docs should explain the required members of the 'page' object (that it needs a path member).

Some simpler examples would be helpful, the wordpress example is unclear with its use of the map and reduce functions.

Actual Result

Unhelpful error messages.

Environment

System:
    OS: macOS 12.3
    CPU: (10) arm64 Apple M1 Max
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.16.0
    Yarn: 3.2.3 
    npm: 8.11.0
  Browsers:
    Chrome: 105.0.5195.125
    Firefox: 103.0.2
    Safari: 15.4

Config Flags

No response

Mike-Dax avatar Sep 17 '22 08:09 Mike-Dax

Hi!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! πŸ’œ

imjoshin avatar Sep 20 '22 16:09 imjoshin

Hiya!

This issue has gone quiet. Spooky quiet. πŸ‘»

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! πŸ’ͺπŸ’œ

github-actions[bot] avatar Oct 11 '22 00:10 github-actions[bot]

gatsby-plugin-sitemap doesn't support gatsby version 2.32.13. Is there an alternative to generate a sitemap for the same? The docs are only there for the more recent versions.

darshika-dev avatar Oct 11 '22 16:10 darshika-dev

Hi!

Since we didn't receive an answer for 7 days or more about the ask of a reproduction I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or open a new issue with a reproduction. Thanks!

LekoArts avatar Oct 25 '22 11:10 LekoArts