Skip to content

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

Closed

Description

@heddendorp

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

Activity

  1. added
    type: bugAn issue or pull request relating to a bug in Gatsby
    on May 5, 2022
  2. added
    status: triage neededIssue or pull request that need to be triaged and assigned to a reviewer
    on May 5, 2022
  3. added
    status: needs reproductionThis issue needs a simplified reproduction of the bug for further troubleshooting.
    and removed
    status: triage neededIssue or pull request that need to be triaged and assigned to a reviewer
    on May 5, 2022
  4. LekoArts commented on May 5, 2022

    @LekoArts
    Contributor

    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!

  5. heddendorp commented on May 5, 2022

    @heddendorp
    Author

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

  6. LekoArts commented on May 5, 2022

    @LekoArts
    Contributor

    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

  7. heddendorp commented on May 5, 2022

    @heddendorp
    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

  8. tmkasun commented on May 29, 2022

    @tmkasun

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs reproductionThis issue needs a simplified reproduction of the bug for further troubleshooting.topic: remark/mdxRelated to Markdown, remark & MDX ecosystemtype: bugAn issue or pull request relating to a bug in Gatsby

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions