[gatsby-plugin-mdx] default layouts prevent compilation #35589
Copy link
Copy link
Closed
Labels
status: needs reproductionThis issue needs a simplified reproduction of the bug for further troubleshooting.This issue needs a simplified reproduction of the bug for further troubleshooting.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
When using the defaultLayouts option in the mdx plugin I can no longer start gatsby as it crashes on compilation
Reproduction Link
https://github.com/heddendorp/developer-portal
Steps to Reproduce
- clone repo
- install deps
- run gatsby develop
Expected Result
The default layout is applied to my pages
Actual Result
The development process crashes at compilation
success compile gatsby files - 2.546s
ERROR #11902 COMPILATION
We encountered an error while trying to compile your site's gatsby-config. Please fix the error and try again.
TypeError: (void 0) is not a function
- gatsby-config.js:1 Object.b3siR.@parcel/transformer-js/src/esmodule-helpers.js
/Users/lu.heddendorpcelonis.com/code/labs/developer-portal/.cache/compiled/gatsby-config.js:1:1654
- gatsby-config.js:1 s
/Users/lu.heddendorpcelonis.com/code/labs/developer-portal/.cache/compiled/gatsby-config.js:1:708
- gatsby-config.js:1
/Users/lu.heddendorpcelonis.com/code/labs/developer-portal/.cache/compiled/gatsby-config.js:1:1123
- gatsby-config.js:1 Object.<anonymous>
/Users/lu.heddendorpcelonis.com/code/labs/developer-portal/.cache/compiled/gatsby-config.js:1:1282
- loader:1105 Module._compile
node:internal/modules/cjs/loader:1105:14
- loader:1159 Object.Module._extensions..js
node:internal/modules/cjs/loader:1159:10
- loader:981 Module.load
node:internal/modules/cjs/loader:981:32
- loader:822 Function.Module._load
node:internal/modules/cjs/loader:822:12
- loader:1005 Module.require
node:internal/modules/cjs/loader:1005:19
- helpers:102 require
node:internal/modules/cjs/helpers:102:18
- get-config-file.ts:34 getConfigFile
[developer-portal]/[gatsby]/src/bootstrap/get-config-file.ts:34:20
- index.ts:22 loadConfig
[developer-portal]/[gatsby]/src/bootstrap/load-config/index.ts:22:50
- initialize.ts:179 initialize
[developer-portal]/[gatsby]/src/services/initialize.ts:179:24
- task_queues:96 processTicksAndRejections
node:internal/process/task_queues:96:5Environment
System:
OS: macOS 12.3.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
Yarn: 1.22.18 - ~/.volta/bin/yarn
npm: 8.5.5 - ~/.volta/tools/image/node/16.15.0/bin/npm
Languages:
Python: 3.9.7 - /Users/lu.heddendorpcelonis.com/opt/anaconda3/bin/python
Browsers:
Firefox: 99.0.1
Safari: 15.4
npmPackages:
gatsby: ^4.13.1 => 4.13.1
gatsby-plugin-layout: ^3.13.0 => 3.13.0
gatsby-plugin-mdx: ^3.13.0 => 3.13.0
gatsby-plugin-react-helmet: ^5.13.0 => 5.13.0
gatsby-plugin-sass: ^5.13.0 => 5.13.0
gatsby-plugin-sitemap: ^5.13.0 => 5.13.0
gatsby-source-filesystem: ^4.13.0 => 4.13.0Config Flags
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status: needs reproductionThis issue needs a simplified reproduction of the bug for further troubleshooting.This issue needs a simplified reproduction of the bug for further troubleshooting.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
Activity
LekoArts commentedon May 5, 2022
Hi!
The repository you linked doesn't use any
defaultLayoutsoption, did you forget to push your changes?. Also, can you directly post your error message into the issue template? "The development process crashes at compilation" is not something we can help with.Thanks!
heddendorp commentedon May 5, 2022
Sorry, my bad, I have pushed the changes and added the error message
LekoArts commentedon May 5, 2022
I'm pretty sure you're hitting this current limitation that you need to workaround: https://www.gatsbyjs.com/docs/how-to/custom-configuration/typescript/#requireresolve
heddendorp commentedon May 5, 2022
You're 100% right @LekoArts I was following some tips online that did not seem to take this into account. Thank you for pointing it out to me
tmkasun commentedon May 29, 2022
@LekoArts
Thanks for the comment, That saved my day 🤝