diff --git a/packages/gatsby-plugin-mdx/loaders/mdx-loader.js b/packages/gatsby-plugin-mdx/loaders/mdx-loader.js index fdd574914b074..a602ca833c5a4 100644 --- a/packages/gatsby-plugin-mdx/loaders/mdx-loader.js +++ b/packages/gatsby-plugin-mdx/loaders/mdx-loader.js @@ -113,10 +113,9 @@ module.exports = async function mdxLoader(content) { if (isolateMDXComponent && !resourceQuery.includes(`type=component`)) { const { data } = grayMatter(content) - const requestPath = `/${path.relative( - this.rootContext, - this.resourcePath - )}?type=component` + const requestPath = slash( + `/${path.relative(this.rootContext, this.resourcePath)}?type=component` + ) return callback( null,