Closed RYRY1002 closed 3 months ago
A solution presented itself in https://github.com/andrewbranch/gatsby-remark-vscode/issues/174#issuecomment-985672859. Replacing
// gatsby-config.ts
{
resolve: "gatsby-plugin-mdx",
options: {
extensions: [".md", ".mdx"],
gatsbyRemarkPlugins: [
{
resolve: "gatsby-remark-vscode",
options: {
theme: {
default: "Light+ (default light)",
dark: "Dark+ (default dark)"
}
}
}
]
}
}
with
// gatsby-config.ts
{
resolve: "gatsby-plugin-mdx",
options: {
mdxOptions: {
remarkPlugins: [
[require("gatsby-remark-vscode").remarkPlugin, {
theme: {
default: "Light+ (default light)",
dark: "Dark+ (default dark)"
}
}]
]
}
}
}
did the trick.
I recall trying this solution before creating this issue, but at the time I discarded the solution as it seems to break all .md
posts, even with .md
being specified as a supported file format. I'm not sure why, it may have something to do with any of a myriad of other plugins currently installed in the project.
I am building a portfolio site with a blog component. The blog uses
gatsby-remark-vscode
for code highlighting. Since implementinggatsby-remark-vscode
, I have switched to usinggatsby-plugin-mdx
fromgatsby-transformer-remark
thanks to being able to include JSX directly in the markdown page.Following the
gatsby-plugin-mdx
documentation as well as code snippets from issues in this repository, I addedgatsby-remark-vscode
as agatsbyRemarkPlugins
entry like so:Then when building the site immediately afterwards I get the following:
The log ends here as the building schema stage will never complete, forcing me to interrupt the build.
I've also tried removing all of the
gatsby-remark-vscode
configuration, like so:I've also tried moving it to the very last plugin in the gatsby config, both with no luck.
Obviously, the stack trace points an issue with GraphQL, but this is my first project using Gatsby and I'm unfamiliar with GraphQL's code base.
The site with the error is available to tinker with at https://github.com/RYRY1002/riley.technology-gatsby/tree/mdx
Thanks in advance.