question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gatsby-transformer-react-docgen fails on hot reloads

See original GitHub issue

Description

The development build keeps crashing when changes are saved in components that seem to have an mdx file associated with it, or at least that seems to be when it fails the most. When the build goes to rebuild, it returns the following error (detailed error below)… UNHANDLED REJECTION Type with name "ComponentMethodParams" does not exists and the server crashes.

Steps to reproduce

In this repo, gatsby-test-project, all you have to do is add a .mdx file that matches the name of a component in that component’s folder. For instance, create a new file at /src/components/app/header.mdx.

In this repo, my-portfolio, if you make any changes to components that seem to have an mdx file associated with them it crashes, such as making a change to /src/components/layout/Layout.js

Expected result

It seems like there’s some sort of race condition going on. I’ve tried moving the plugin around in the list within the gatsby-config.js file, but it doesn’t seem to make a difference. It should not crash with the following error…

UNHANDLED REJECTION Type with name "ComponentMethodParams" does not exists



  Error: Type with name "ComponentMethodParams" does not exists
  
  - TypeStorage.js:44 SchemaComposer.get
    [gatsby-test-project]/[graphql-compose]/lib/TypeStorage.js:44:13
  
  - SchemaComposer.js:530 SchemaComposer.getAnyTC
    [gatsby-test-project]/[graphql-compose]/lib/SchemaComposer.js:530:19
  
  - sort.js:116 Object.keys.forEach.fieldName
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:116:45
  
  - Array.forEach
  
  - sort.js:92 convert
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:92:23
  
  - sort.js:117 Object.keys.forEach.fieldName
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:117:35
  
  - Array.forEach
  
  - sort.js:92 convert
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:92:23
  
  - sort.js:117 Object.keys.forEach.fieldName
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:117:35
  
  - Array.forEach
  
  - sort.js:92 convert
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:92:23
  
  - sort.js:45 getFieldsEnum
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:45:18
  
  - sort.js:58 getSortInput
    [gatsby-test-project]/[gatsby]/dist/schema/types/sort.js:58:24
  
  - schema.js:1104 addTypeToRootQuery
    [gatsby-test-project]/[gatsby]/dist/schema/schema.js:1104:23
  
  - schema.js:270 processTypeComposer
    [gatsby-test-project]/[gatsby]/dist/schema/schema.js:270:13
  
  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7
  

not finished rebuild schema - 0.296s

Environment

  System:
    OS: macOS 10.15.1
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.13.0 - /usr/local/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.13.2 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/local/bin/python
  Browsers:
    Chrome: 78.0.3904.108
    Safari: 13.0.3
  npmPackages:
    gatsby: ^2.18.10 => 2.18.10
    gatsby-image: ^2.2.36 => 2.2.36
    gatsby-plugin-manifest: ^2.2.33 => 2.2.33
    gatsby-plugin-mdx: ^1.0.61 => 1.0.61
    gatsby-plugin-offline: ^3.0.29 => 3.0.29
    gatsby-plugin-react-helmet: ^3.1.18 => 3.1.18
    gatsby-plugin-sass: ^2.1.26 => 2.1.26
    gatsby-plugin-sharp: ^2.3.7 => 2.3.7
    gatsby-source-filesystem: ^2.1.42 => 2.1.42
    gatsby-transformer-react-docgen: ^5.0.24 => 5.0.24
    gatsby-transformer-sharp: ^2.3.9 => 2.3.9
  npmGlobalPackages:
    gatsby: 2.18.5

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
behivetechcommented, Dec 12, 2019

So far so good! Thanks again!!! Updated to gatsby@2.18.11 and gatsby-transformer-react-docgen@5.0.25, made a typical change that crashes the dev server and no crashes this time.

1reaction
vladarcommented, Dec 12, 2019

Please try the fix in gatsby-transformer-react-docgen@5.0.25

Read more comments on GitHub >

github_iconTop Results From Across the Web

🔥 fixing react-hot-loader in gatsby
The problem lies with react-hot-loader, the package Gatsby uses for hot reloading react components. The warning is telling us that the ...
Read more >
Untitled
43 views June 25, 2021 css css css-modules gatsby reactjs storybook. js file and can ... hot 17 Progressively Slowed Builds with react-docgen-typescript...
Read more >
gatsby | Yarn - Package Manager
Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.
Read more >
Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >
npm
... @throw-out-error/minecraft-datapack · @tippy.js/react · @toast-ui/editor-plugin-chart ... @weknow/gatsby-remark-twitch · @welogix/react-data-grid ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found