gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.32k forks source link

Menu Links randomly disappear in develop and / or build #37751

Closed maweo closed 1 year ago

maweo commented 1 year ago

Preliminary Checks

Description

We face a strange behaviour on one of our gatsby frontends. Every build / develop, one or more links from the menu are missing. It is not the same link, sometimes it’s just one link missing, sometimes more.

We tried to trace the error via the steps in the trouble-shooting-section. In WPGraphQL, all of the links are there. When enabling writeQueriesToDisk: true the links are here as well.

In localhost:8000/__graphql, the links are missing, and therefore in the frontend as well. Strangely, when using count in GraphQL, it says the right number of links, while showing fewer links right afterwards. As an example, when we have 4 links in the wp-menu, count says “4", but only 3 links are shown in the query.

We tried playing around with the versions, didn’t change anything. Any ideas, what we can do here?

Relevant dependencies: “gatsby”: “^4.11.2" “gatsby-source-wordpress”: “^6.11.2"

Reproduction Link

/

Steps to Reproduce

Expected Result

Get all entries from the GraphQl Query, when the count is 4, the query should contain 4 entries (we get 3).

Actual Result

The Query count is 4, items that are returned are 3.

Environment

System:
    OS: macOS 12.2.1
    CPU: (8) arm64 Apple M1
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 18.13.0 - /opt/homebrew/opt/node@18/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.3 - /opt/homebrew/opt/node@18/bin/npm
  Languages:
    Python: 2.7.18 - /usr/bin/python
  Browsers:
    Chrome: 111.0.5563.64
    Safari: 15.3
  npmPackages:
    gatsby: ^4.11.2 => 4.25.2
    gatsby-background-image: ^1.5.3 => 1.6.0
    gatsby-image: ^3.11.0 => 3.11.0
    gatsby-plugin-breakpoints: ^1.3.5 => 1.3.9
    gatsby-plugin-catch-links: ^4.11.0 => 4.25.0
    gatsby-plugin-eslint: ^4.0.0 => 4.0.3
    gatsby-plugin-gatsby-cloud: ^4.11.1 => 4.25.0
    gatsby-plugin-gdpr-cookies: ^2.0.6 => 2.0.9
    gatsby-plugin-image: ^2.11.1 => 2.25.0
    gatsby-plugin-manifest: ^4.11.1 => 4.25.0
    gatsby-plugin-offline: ^4.13.0 => 4.15.0
    gatsby-plugin-preact: ^6.11.0 => 6.25.0
    gatsby-plugin-react-helmet: ^5.11.0 => 5.25.0
    gatsby-plugin-react-svg: ^3.1.0 => 3.3.0
    gatsby-plugin-root-import: ^2.0.5 => 2.0.9
    gatsby-plugin-sass: ^5.11.1 => 5.25.0
    gatsby-plugin-sharp: ^4.11.1 => 4.25.0
    gatsby-plugin-sitemap: ^5.7.0 => 5.25.0
    gatsby-plugin-transition-link: ^1.20.5 => 1.20.5
    gatsby-plugin-webfonts: ^2.1.1 => 2.3.2
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.17 => 1.1.30
    gatsby-source-filesystem: ^4.11.1 => 4.25.0
    gatsby-source-instagram-all: ^5.2.1 => 5.2.1
    gatsby-source-wordpress: ^6.11.2 => 6.25.2
    gatsby-transformer-sharp: ^3.13.0 => 3.15.0
  npmGlobalPackages:
    gatsby-cli: 5.6.0

Config Flags

No response

LekoArts commented 1 year ago

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! 💜

char-cole commented 1 year ago

I've also encountered this issue on a site with a WordPress backend. We gave up and hard-coded the menu as a stopgap.

"gatsby": "^4.24.7", "gatsby-source-wordpress": "^6.14.1",

nayrbzer commented 1 year ago

I encountered this issue so I decided to create custom graphql which displays all the menus and have an identifier. With limitation that you can’t pass arguments to fields you can add id as type.

LekoArts commented 1 year ago

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!

Jeet022 commented 1 year ago

Hi @LekoArts

I am facing the same issue, when sometime MENU are available in CMS ( wordpress ) but on front end it disappear. When i do some changes in them ( and then revert ) those are reflected back on Gatsby after build.

I am not sure how to replicate this issue.