gatsby-types.d.ts is not generated
See original GitHub issueIssue Description
Hello!
I’m trying to install and set up this plugin, but I’m unable to get the types-file generated (gatsby-types.d.ts).
This is my config for this plugin:
{
resolve: 'gatsby-plugin-typegen',
options: {
outputPath: 'src/__generated__/gatsby-types.d.ts',
includeResolvers: false,
emitSchema: {
'src/__generated__/gatsby-schema.graphql': true,
'src/__generated__/gatsby-introspection.json': true,
},
emitPluginDocuments: {
'src/__generated__/gatsby-plugin-documents.graphql': true,
},
},
},
After I run either gatsby develop
or gatsby build
, the only files that end up in the __generated__
folder is:
gatsby-introspection.json
gatsby-schema.graphql
These are some relevant plugins that I’m are using:
"gatsby-plugin-ts": "^2.7.1",
"gatsby-plugin-typegen": "^2.2.4",
"gatsby": "^2.32.4",
I did some digging into your code, and it seems as QUERY_EXTRACTION_BABEL_SUCCESS
is never triggered. Added a debug log where it checks for that action. These are the actions types that it was able to pick up:
CREATE_TYPES
CREATE_NODE
TOUCH_NODE
DELETE_NODE
BUILD_TYPE_METADATA
START_INCREMENTAL_INFERENCE
DISABLE_TYPE_INFERENCE
SET_SCHEMA_COMPOSER
SET_SCHEMA
CREATE_REDIRECT
CREATE_PAGE
API_FINISHED
These are the typegen logs:
[typegen] Successfully validate your configuration.
{
"language": "typescript",
"namespace": "GatsbyTypes",
"outputPath": "src/__generated__/gatsby-types.d.ts",
"includeResolvers": false,
"autoFix": true,
"emitSchema": {
"src/__generated__/gatsby-schema.graphql": {
"format": "sdl",
"commentDescriptions": true
},
"src/__generated__/gatsby-introspection.json": {
"format": "introspection",
"commentDescriptions": true
}
},
"emitPluginDocuments": {
"src/__generated__/gatsby-plugin-documents.graphql": true
},
"scalars": {}
}
[typegen] Listen on query extraction
[typegen] End-up listening on query extraction.
[typegen] Watching schema/query changes and re-run workers
[typegen] Emit Gatsby schema into src/__generated__/gatsby-schema.graphql
[typegen] Emit Gatsby schema into src/__generated__/gatsby-introspection.json
Any ideas?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
gatsby-plugin-typegen
Features · Schema extraction · Plugin documents extraction · Generates type definitions for TypeScript & Flow, using graphql-codegen · Auto-fixing <StaticQuery> and ...
Read more >gatsby-plugin-typegen - Bountysource
Hi, I'm trying to get types generated for my root query in gatsby-node.ts. Somehow this seems to not work. I used a query...
Read more >TypeScript typings give me "index.d.ts is not a module"
In my case, I was getting this error message with an index.d.ts file generated by the TypeScript compiler. The problem was that I'd...
Read more >Gatsby: .../reference/release-notes/v4.18/index.md | Fossies
By default, it's generated in the src/gatsby-types.d.ts location. ... we disabled DEV_SSR flag because getServerData was not properly handled.
Read more >Gatsby Changelog | 5.3.0
Fix store not containing auth credentials, via PR #37006. gatsby-transformer-csv : ... By default, it's generated in the src/gatsby-types.d.ts location.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be fixed in v3, and I will test it on my Gatsby Cloud today.
v3 doesn’t use
QUERY_EXTRACTION_BABEL_SUCCESS
action anymore.Facing the same issue … quite frustrating, since it cannot be reproduced reliably, and breaks CI. (parallel soucing is diabled) Looking forward to v3 😊