gatsby develop crashing on building schema
See original GitHub issueDescription
gatsby develop crashing on building schema, after removing ‘gatsby-source-prismic’ plugin
`UNHANDLED REJECTION Type with name “File” does not exists
Error: Type with name “File” does not exists
-
TypeStorage.js:44 SchemaComposer.get [*****-prismic-gatsby]/[graphql-compose]/lib/TypeStorage.js:44:13
-
TypeMapper.js:86 TypeMapper.get [*****-prismic-gatsby]/[graphql-compose]/lib/TypeMapper.js:86:44
-
TypeMapper.js:608 TypeMapper.typeFromAST [*****-prismic-gatsby]/[graphql-compose]/lib/TypeMapper.js:608:17
-
TypeMapper.js:105 TypeMapper.getWrapped [*****-prismic-gatsby]/[graphql-compose]/lib/TypeMapper.js:105:17
-
TypeMapper.js:272 TypeMapper.convertOutputFieldConfig [*****-prismic-gatsby]/[graphql-compose]/lib/TypeMapper.js:272:114
-
configAsThunk.js:19 resolveOutputConfigAsThunk [*****-prismic-gatsby]/[graphql-compose]/lib/utils/configAsThunk.js:19:41
-
ObjectTypeComposer.js:300 ObjectTypeComposer.getFieldConfig [*****-prismic-gatsby]/[graphql-compose]/lib/ObjectTypeComposer.js:300:58
-
ObjectTypeComposer.js:304 ObjectTypeComposer.getFieldType [*****-prismic-gatsby]/[graphql-compose]/lib/ObjectTypeComposer.js:304:17
-
SchemaComposer.js:144 tc.getFieldNames.forEach.fieldName [*****-prismic-gatsby]/[graphql-compose]/lib/SchemaComposer.js:144:28
-
Array.forEach
-
SchemaComposer.js:143 SchemaComposer.removeEmptyTypes [*****-prismic-gatsby]/[graphql-compose]/lib/SchemaComposer.js:143:24
-
SchemaComposer.js:154 tc.getFieldNames.forEach.fieldName [*****-prismic-gatsby]/[graphql-compose]/lib/SchemaComposer.js:154:18
-
Array.forEach
-
SchemaComposer.js:143 SchemaComposer.removeEmptyTypes [*****-prismic-gatsby]/[graphql-compose]/lib/SchemaComposer.js:143:24
-
SchemaComposer.js:154 tc.getFieldNames.forEach.fieldName [*****-prismic-gatsby]/[graphql-compose]/lib/SchemaComposer.js:154:18
-
Array.forEach `
Environment
System: OS: macOS 10.14.5 CPU: (4) x64 Intel® Core™ i5-3427U CPU @ 1.80GHz Shell: 2.5.0 - /usr/local/bin/fish Binaries: Node: 10.15.3 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.10.1 - /usr/local/bin/npm Languages: Python: 2.7.10 - /usr/bin/python Browsers: Chrome: 73.0.3683.86 Firefox: 67.0.4 Safari: 12.1.1 npmPackages: gatsby: 2.13.41 => 2.13.41 gatsby-cli: 2.5.13 => 2.5.13 gatsby-image: 2.0.41 => 2.0.41 gatsby-paginate: 1.0.17 => 1.0.17 gatsby-plugin-eslint: 2.0.5 => 2.0.5 gatsby-plugin-google-tagmanager: 2.0.13 => 2.0.13 gatsby-plugin-offline: ^2.1.1 => 2.2.4 gatsby-plugin-prismic-preview: 2.0.0 => 2.0.0 gatsby-plugin-react-helmet: 3.0.12 => 3.0.12 gatsby-plugin-sharp: 2.0.37 => 2.0.37 gatsby-plugin-styled-components: 3.0.7 => 3.0.7 gatsby-plugin-typography: 2.2.13 => 2.2.13 gatsby-source-graphql-universal: 3.1.6 => 3.1.6 gatsby-source-prismic-graphql: 3.4.0-beta.0 => 3.4.0-beta.0 gatsby-transformer-sharp: 2.1.19 => 2.1.19 npmGlobalPackages: gatsby-cli: 2.7.21
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
I’m not sure those two errors actually have the same cause.
@danhowitt i hope the error you’re getting is fixed in
gatsby@2.13.45
.@lalmachado something in your project expects a
File
type to be in the schema but it isn’t. You can try either addinggatsby-source-filesystem
to your project, which will add the File type (when there’s at least one file present); or try thecreateTypes
action to manually add a File type (hard to say if/how this would work without more info)important note for
gatsby-source-graphql
(and in case it is not enough to install the plugin for you):I also had to put – unlike at other source plugins – in the
gatsby-config.js
for the plugin (gatsby-source-filesystem)
the config snippetNOTE: The path must be a valid path but it doesn’t have to contain any files, an empty folder works too.
Here’s an example config for the plugin:
This could’ve saved me a lot of time, hope it helps somebody! 😃