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

Enabled schema in the RM dashboard ruins FE builds #114

Open
2 of 3 tasks
floretsky opened this issue Nov 14, 2024 · 2 comments
Open
2 of 3 tasks

Enabled schema in the RM dashboard ruins FE builds #114

floretsky opened this issue Nov 14, 2024 · 2 comments

Comments

@floretsky
Copy link

floretsky commented Nov 14, 2024

Description

Hello!

I encountered a problem with the schema (Structured Data) setting enabled in the RM dashboard:

Image

I have been chatting with the RM developers about it and they have suggested to implement a fix which didn't fix it for me.

The code that is ruining the builds is located under \plugins\seo-by-rank-math\includes\modules\schema\class-snippet-shortcode.php
It's not a part of the wp-graphql-rank-math plugin, but seems like this part of code is running multiple times because wp-graphql-rank-math creates an instance of RM which runs this code part multiple times and throws Internal Server Error

Steps to reproduce

My website build is based on the stack which includes faustjs, sage theme and bedrock
WPGraphQL Query I'm running is

fragment SEOInformationFragment on NodeWithRankMathSeo {
      seo { 
        fullHead
        breadcrumbTitle
        breadcrumbs {
          text
          url
          isHidden
        }
        canonicalUrl
        description
        focusKeywords
        jsonLd {
          raw
        }
        robots
        title
        openGraph {
          articleMeta {
            section
          }
          description
          locale
          siteName
          title
          type
          url
          slackEnhancedData {
            data
            label
          }
          twitterMeta {
            card
            description
            title
          }
        }
      }
    }

Let me know if I can provide any more additional helpful information. Thank you!

Additional context

No response

Plugin Version

0.3.2

WordPress Version

6.6.2

WPGraphQL Version

1.29.0

RankMath SEO Version

1.0.232

Additional enviornmental details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.
@justlevine
Copy link
Member

Hey @floretsky and thanks for the thorough bug report!

Yeah sadly seems the support team's response isn't relevant in this case.

seems like this part of code is running multiple times because wp-graphql-rank-math creates an instance of RM

Can you clarify what you mean by this? I'm currently afk, but I to my memory, this is what we reset/reinstantiate

@floretsky
Copy link
Author

Hi @justlevine ! Thanks for your reply!

Ah, my mistake! During my last troubleshooting session, I thought I found out that the RankMath\Schema\Snippet_Shortcode constructor was being executed twice, which caused my builds to fail. But that doesn't seem to be the issue here. I have the Headless CMS Support setting enabled in RankMath. Seems like with the "Schema" setting enabled, it attempts to register the rank-math/rich-snippet block for every GraphQL node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants