-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Labels
status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.topic: remark/mdxRelated to Markdown, remark & MDX ecosystemRelated to Markdown, remark & MDX ecosystemtype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- 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
The example of creating "headings" GraphQL node seem like missing some thing when calling the compileMDXWithCustomOptions.
The resolver yield "TypeError: Cannot read properties of undefined (reading 'getState')".
And i found the secend parameters of the compileMDXWithCustomOptions, which is a object owning "store" attribute. This object would be passed down to enhanceMdxOptions, which would call the getState from the store.
| store: NodePluginArgs["store"] |
| const { config } = helpers.store.getState() |
Therefore, at the example, the object is missing the "store" attribute, undefined has no
getState, and that causing the error.But i have no idea what is the "store" meaning for, and what to pass in.
Reproduction Link
https://codesandbox.io/s/damp-sea-e242s4?file=/gatsby-node.js
Steps to Reproduce
Just follow the gatsby-plugin-mdx doc.
Expected Result
GraphQL resolve the heading properly.
Actual Result
GraphlQL yield "TypeError: Cannot read properties of undefined (reading 'getState')"
Environment
System: win11
Gatsby:4.22.1
gatsby-plugin-mdx:4.1.1Config Flags
No response
Metadata
Metadata
Assignees
Labels
status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.topic: remark/mdxRelated to Markdown, remark & MDX ecosystemRelated to Markdown, remark & MDX ecosystemtype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby