gatsby-transformer-react-docgen fails on hot reloads
See original GitHub issueDescription
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:
- Created 4 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top GitHub Comments
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.
Please try the fix in
gatsby-transformer-react-docgen@5.0.25