Describe the bug
ERROR #11328
A page component must export a React component for it to be valid. Please make sure this file exports a React component:
undefined
This error is thrown when I'm trying the Gatsby Remark VSCode with Docz
To Reproduce
Following the guide will lead to the problem:
curl https://codeload.github.com/doczjs/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/with-gatsby-remark-vscode
mv with-gatsby-remark-vscode docz-with-gatsby-remark-vscode-example
cd docz-with-gatsby-remark-vscode-example
npm run build
Expected behavior
No error
Environment
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.

I found that this may caused by the update of gatsby, when I use yarn's resolutions to set [email protected], this error no longer exists.
Same Issue. @roland-reed's workaround worked fine.
Also started getting this issue. Yarn resolution fixed it for me as well.
same issue. I think the root cause of this issue is mdx v2 of gatsbyjs.
same issue. I agree with @nguyenletan.
same issue. I agree with @nguyenletan.
Upgrade gatsby to latest version will slove it.
I have to reopen this issue, same problem in [email protected].
@roland-reed You closed the issue, what did you do to solve it?
@roland-reed You closed the issue, what did you do to solve it?
docz has fixed this, so no extra step is required.
i Have the same Error
System:
OS: macOS 10.15.6
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v12.18.2/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.18.2/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.75
Firefox: 79.0
Safari: 13.1.2
npmPackages:
gatsby: 2.24.75 => 2.24.75
gatsby-cli: ^2.12.107 => 2.12.107
gatsby-plugin-create-client-paths: ~2.3.13 => 2.3.13
gatsby-plugin-offline: ^3.2.31 => 3.2.31
gatsby-plugin-react-helmet: ~3.3.14 => 3.3.14
gatsby-plugin-root-import: ~2.0.5 => 2.0.5
gatsby-plugin-sass: ~2.3.16 => 2.3.16
gatsby-plugin-static-folders: ~1.0.1 => 1.0.1
gatsby-plugin-web-font-loader: ~1.0.4 => 1.0.4
npmGlobalPackages:
gatsby-cli: 2.12.107
Most helpful comment
I found that this may caused by the update of gatsby, when I use yarn's resolutions to set [email protected], this error no longer exists.