Closed prathameshjchavan closed 2 years ago
$ npm run develop
gatsby-starter-default@0.1.0 develop gatsby develop -H 192.168.0.103
success compile gatsby files - 55.729s success load gatsby config - 0.317s success load plugins - 14.000s Loaded gatsby-source-strapi-plugin success onPreInit - 0.149s success initialize cache - 1.033s success copy gatsby files - 5.661s success Compiling Gatsby Functions - 14.572s success onPreBootstrap - 15.156s success createSchemaCustomization - 0.020s
ERROR #11321 PLUGIN
"gatsby-source-strapi" threw an error while running the sourceNodes lifecycle:
connect ECONNREFUSED ::1:1337
Error: connect ECONNREFUSED ::1:1337
warn The gatsby-source-strapi plugin has generated no Gatsby nodes. Do you need it? This could also suggest the plugin is misconfigured. success Checking for changed pages - 0.001s success source and transform nodes - 1.509s success building schema - 0.673s success createPages - 0.007s success createPagesStatefully - 0.324s info Total nodes: 109, SitePage nodes: 9 (use --verbose for breakdown) success Checking for changed pages - 0.001s success write out redirect data - 0.003s success onPostBootstrap - 0.006s info bootstrap finished - 232.403s success onPreExtractQueries - 0.001s
ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "allStrapiProduct" on type "Query".
If you don't expect "allStrapiProduct" to exist on the type "Query" it is most likely a typo. However, if you expect "allStrapiProduct" to exist there are a couple of solutions to common problems:
It is recommended to explicitly type your GraphQL schema if you want to use optional fields.
File: src\components\home\PromotionalProducts.js:16:7
See our docs page for more info on this error: https://gatsby.dev/creating-type-definitions
ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "allStrapiProduct" on type "Query".
If you don't expect "allStrapiProduct" to exist on the type "Query" it is most likely a typo. However, if you expect "allStrapiProduct" to exist there are a couple of solutions to common problems:
It is recommended to explicitly type your GraphQL schema if you want to use optional fields.
File: src\components\home\FeaturedProducts.js:19:7
See our docs page for more info on this error: https://gatsby.dev/creating-type-definitions
ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "allStrapiCategory" on type "Query".
If you don't expect "allStrapiCategory" to exist on the type "Query" it is most likely a typo. However, if you expect "allStrapiCategory" to exist there are a couple of solutions to common problems:
It is recommended to explicitly type your GraphQL schema if you want to use optional fields.
File: src\components\ui\layout.js:10:7
See our docs page for more info on this error: https://gatsby.dev/creating-type-definitions
failed extract queries from components - 7.051s success write out requires - 0.043s success run static queries - 0.057s - 1/1 17.45/s success run page queries - 0.029s - 3/3 103.88/s
ERROR
Module not found: Error: Can't resolve '../../../public/page-data/sq/d/2105022444.json' in 'D:\React Projects\var_x\frontend\src\components\home'
ModuleNotFoundError: Module not found: Error: Can't resolve '../../../public/p age-data/sq/d/2105022444.json' in 'D:\React Projects\var_x\frontend\src\compon ents\home'
Compilation.js:2016 [frontend]/[webpack]/lib/Compilation.js:2016:28
NormalModuleFactory.js:798 [frontend]/[webpack]/lib/NormalModuleFactory.js:798:13
NormalModuleFactory.js:270 [frontend]/[webpack]/lib/NormalModuleFactory.js:270:22
NormalModuleFactory.js:434 [frontend]/[webpack]/lib/NormalModuleFactory.js:434:22
NormalModuleFactory.js:116 [frontend]/[webpack]/lib/NormalModuleFactory.js:116:11
NormalModuleFactory.js:670 [frontend]/[webpack]/lib/NormalModuleFactory.js:670:25
NormalModuleFactory.js:855 [frontend]/[webpack]/lib/NormalModuleFactory.js:855:8
NormalModuleFactory.js:975 [frontend]/[webpack]/lib/NormalModuleFactory.js:975:5
async.js:6883 [frontend]/[neo-async]/async.js:6883:13
NormalModuleFactory.js:950 Array.
async.js:2517 arrayEachFunc [frontend]/[neo-async]/async.js:2517:19
async.js:6858 Object.parallel [frontend]/[neo-async]/async.js:6858:9
NormalModuleFactory.js:873 NormalModuleFactory._resolveResourceErrorHints [frontend]/[webpack]/lib/NormalModuleFactory.js:873:12
NormalModuleFactory.js:834 [frontend]/[webpack]/lib/NormalModuleFactory.js:834:18
ERROR
Module not found: Error: Can't resolve '../../../public/page-data/sq/d/2611317079.json' in 'D:\React Projects\var_x\frontend\src\components\home'
ModuleNotFoundError: Module not found: Error: Can't resolve '../../../public/p age-data/sq/d/2611317079.json' in 'D:\React Projects\var_x\frontend\src\compon ents\home'
Compilation.js:2016 [frontend]/[webpack]/lib/Compilation.js:2016:28
NormalModuleFactory.js:798 [frontend]/[webpack]/lib/NormalModuleFactory.js:798:13
NormalModuleFactory.js:270 [frontend]/[webpack]/lib/NormalModuleFactory.js:270:22
NormalModuleFactory.js:434 [frontend]/[webpack]/lib/NormalModuleFactory.js:434:22
NormalModuleFactory.js:116 [frontend]/[webpack]/lib/NormalModuleFactory.js:116:11
NormalModuleFactory.js:670 [frontend]/[webpack]/lib/NormalModuleFactory.js:670:25
NormalModuleFactory.js:855 [frontend]/[webpack]/lib/NormalModuleFactory.js:855:8
NormalModuleFactory.js:975 [frontend]/[webpack]/lib/NormalModuleFactory.js:975:5
async.js:6883 [frontend]/[neo-async]/async.js:6883:13
NormalModuleFactory.js:950 Array.
async.js:2517 arrayEachFunc [frontend]/[neo-async]/async.js:2517:19
async.js:6858 Object.parallel [frontend]/[neo-async]/async.js:6858:9
NormalModuleFactory.js:873 NormalModuleFactory._resolveResourceErrorHints [frontend]/[webpack]/lib/NormalModuleFactory.js:873:12
NormalModuleFactory.js:834 [frontend]/[webpack]/lib/NormalModuleFactory.js:834:18
ERROR
Module not found: Error: Can't resolve '../../../public/page-data/sq/d/3765042692.json' in 'D:\React Projects\var_x\frontend\src\components\ui'
ModuleNotFoundError: Module not found: Error: Can't resolve '../../../public/p age-data/sq/d/3765042692.json' in 'D:\React Projects\var_x\frontend\src\compon ents\ui'
Compilation.js:2016 [frontend]/[webpack]/lib/Compilation.js:2016:28
NormalModuleFactory.js:798 [frontend]/[webpack]/lib/NormalModuleFactory.js:798:13
NormalModuleFactory.js:270 [frontend]/[webpack]/lib/NormalModuleFactory.js:270:22
NormalModuleFactory.js:434 [frontend]/[webpack]/lib/NormalModuleFactory.js:434:22
NormalModuleFactory.js:116 [frontend]/[webpack]/lib/NormalModuleFactory.js:116:11
NormalModuleFactory.js:670 [frontend]/[webpack]/lib/NormalModuleFactory.js:670:25
NormalModuleFactory.js:855 [frontend]/[webpack]/lib/NormalModuleFactory.js:855:8
NormalModuleFactory.js:975 [frontend]/[webpack]/lib/NormalModuleFactory.js:975:5
async.js:6883 [frontend]/[neo-async]/async.js:6883:13
NormalModuleFactory.js:950 Array.
async.js:2517 arrayEachFunc [frontend]/[neo-async]/async.js:2517:19
async.js:6858 Object.parallel [frontend]/[neo-async]/async.js:6858:9
NormalModuleFactory.js:873 NormalModuleFactory._resolveResourceErrorHints [frontend]/[webpack]/lib/NormalModuleFactory.js:873:12
NormalModuleFactory.js:834 [frontend]/[webpack]/lib/NormalModuleFactory.js:834:18
not finished Building development bundle - 39.018s
The plugin is trying to connect the a local server on port 1337, which is probably not running
@laurenskling , strapi server is running on localhost:1337, but it still show the same error, i am using gatsby v4, if i switch to gatsby v2 it works smooth, but i want it working with v4. i am facing the same issue :(
Just to be sure, in Strapi 4 an API token is mandatory now. Did you add a full-access API token to Strapi first (Settings > API Tokens)? Then copy the token and paste it to a (new) env.development file in the Gatsby root. See https://www.gatsbyjs.com/plugins/gatsby-source-strapi/
Hope it helps, Jacco
The problem has been solved. Thanks for your suggestions. I've tried all of them and would definitely help to fix this issue. But, this error is caused due to mismatch file name in my gatsby imports. I had a file named HeroBlock.js in my working directory which I was importing as heroblock.js in my code.
Sometimes, It was successfully compiling by downgrading Gatsby version. But, it doesn't worked as expected like it was not performing hot reloading while development and would only change after server restarts. Such typos in the code wouldn't get compiled with the latest Gatsby version and throws the above error stack.
It was such a hard time for me to figure out the typo as there was no error message indicating the same. Thanks for your support and do consider this solution if you get such errors.