Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-plugin-mdx] default layouts prevent compilation #35589

Closed
2 tasks done
heddendorp opened this issue May 5, 2022 · 5 comments
Closed
2 tasks done

[gatsby-plugin-mdx] default layouts prevent compilation #35589

heddendorp opened this issue May 5, 2022 · 5 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: remark/mdx Related to Markdown, remark & MDX ecosystem type: bug An issue or pull request relating to a bug in Gatsby

Comments

@heddendorp
Copy link

heddendorp commented May 5, 2022

Preliminary Checks

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

  1. clone repo
  2. install deps
  3. 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:5

Environment

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.0

Config Flags

No response

@heddendorp heddendorp added the type: bug An issue or pull request relating to a bug in Gatsby label May 5, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 5, 2022
@LekoArts LekoArts added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 5, 2022
@LekoArts
Copy link
Contributor

LekoArts commented May 5, 2022

Hi!

The repository you linked doesn't use any defaultLayouts option, 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!

@LekoArts LekoArts added the topic: remark/mdx Related to Markdown, remark & MDX ecosystem label May 5, 2022
@heddendorp
Copy link
Author

Sorry, my bad, I have pushed the changes and added the error message

@LekoArts
Copy link
Contributor

LekoArts commented 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
Copy link
Author

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
Copy link

tmkasun commented May 29, 2022

@LekoArts

Thanks for the comment, That saved my day 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: remark/mdx Related to Markdown, remark & MDX ecosystem type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants