0

I'm very new to Gatsby and ReactJS and I received this when trying to run yarn dev. I just inherited this project and no one has worked on it for a year, so I'm worried about the dependencies being out-of-date and deprecated. I ran yarn install and yarn update which resulted in the dependencies being installed, but there were a lot of unmet peer dependencies.

[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "gatsby > eslint-config-react-app@6.0.0" has unmet peer dependency "babel-eslint@^10.0.0".
warning "gatsby > react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825" has incorrect peer dependency "react@0.0.0-experimental-c8b778b7f-20220825".      
warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "gatsby > react-dev-utils > fork-ts-checker-webpack-plugin@6.5.2" has unmet peer dependency "typescript@>= 2.7".
warning " > gatsby-plugin-image@2.24.0" has unmet peer dependency "@babel/core@^7.12.3".
warning " > gatsby-plugin-sass@5.24.0" has unmet peer dependency "sass@^1.30.0".
warning "gatsby-plugin-sass > sass-loader@10.3.1" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
warning " > gatsby-plugin-styled-components@5.24.0" has unmet peer dependency "babel-plugin-styled-components@>1.5.0".
warning " > google-maps-react@2.0.6" has incorrect peer dependency "react@~0.14.8 || ^15.0.0 || ^16.0.0".
warning " > google-maps-react@2.0.6" has incorrect peer dependency "react-dom@~0.14.8 || ^15.0.0 || ^16.0.0".
warning " > react-google-maps@9.4.5" has unmet peer dependency "@types/googlemaps@^3.0.0".
warning " > react-google-maps@9.4.5" has unmet peer dependency "@types/markerclustererplus@^2.1.29".
warning " > react-google-maps@9.4.5" has unmet peer dependency "@types/react@^15.0.0 || ^16.0.0".
warning " > react-google-maps@9.4.5" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
warning " > react-google-maps@9.4.5" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
warning "react-google-maps > recompose@0.26.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
warning "react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
warning " > styled-components@5.3.6" has unmet peer dependency "react-is@>= 16.8.0".
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
Done in 353.89s.

This is the error I got when I tried yarn dev afterwards though which runs the command yarn gatsby develop.

yarn run v1.22.19
$ gatsby develop
success compile gatsby files - 8.915s
success load gatsby config - 0.114s
success load plugins - 2.453s
warn gatsby-plugin-react-helmet: Gatsby now has built-in support for modifying the document head. Learn more at https://gatsby.dev/gatsby-head
success onPreInit - 0.036s
success initialize cache - 0.318s
success copy gatsby files - 0.690s
success Compiling Gatsby Functions - 1.209s
success onPreBootstrap - 1.332s
success createSchemaCustomization - 0.025s
success Checking for changed pages - 0.004s
success source and transform nodes - 0.579s
success building schema - 0.609s
success createPages - 0.010s
success createPagesStatefully - 0.294s
info Total nodes: 79, SitePage nodes: 6 (use --verbose for breakdown)
success Checking for changed pages - 0.002s
success write out redirect data - 0.004s
success Build manifest and related icons - 0.232s
success onPostBootstrap - 0.247s
info bootstrap finished - 26.365s
success onPreExtractQueries - 0.002s
success extract queries from components - 2.885s
success write out requires - 0.187s
warn [gatsby-transformer-sharp] The "fixed" and "fluid" resolvers are now deprecated. Switch to "gatsby-plugin-image" for better performance and a simpler API. See
https://gatsby.dev/migrate-images to learn how.
success run static queries - 3.523s - 4/4 1.14/s
success run page queries - 0.032s - 3/3 92.65/s
success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 3.427s - 19/19 5.54/s

 ERROR 

Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.module.rules[12] should be one of these:
   ["..." | object { assert?, compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, issuerLayer?, layer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, scheme?, sideEffects?, test?, type?, use? }, ...]        
   -> A rule.
   Details:
    * configuration.module.rules[11].issuer has an unknown property 'test'. These properties are valid:
      object { and?, not?, or? }
      -> Logic operators used in a condition matcher.
    * configuration.module.rules[12].issuer has an unknown property 'test'. These properties are valid:
      object { and?, not?, or? }
      -> Logic operators used in a condition matcher.



  ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
   - configuration.module.rules[12] should be one of these:
     ["..." | object { assert?, compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, issuerLayer?, layer?, loader?, mimetype  ?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, scheme?, sideEffects?, test?, type?, use? }, ...]    
     -> A rule.
     Details:
      * configuration.module.rules[11].issuer has an unknown property 'test'. These properties are valid:
        object { and?, not?, or? }
        -> Logic operators used in a condition matcher.
      * configuration.module.rules[12].issuer has an unknown property 'test'. These properties are valid:
        object { and?, not?, or? }
        -> Logic operators used in a condition matcher.

  - validate.js:105 validate
    [amacss_frontend]/[schema-utils]/dist/validate.js:105:11

  - validateSchema.js:78 validateSchema
    [amacss_frontend]/[webpack]/lib/validateSchema.js:78:2

  - webpack.js:111 create
    [amacss_frontend]/[webpack]/lib/webpack.js:111:24

  - webpack.js:158 webpack
    [amacss_frontend]/[webpack]/lib/webpack.js:158:32

  - index.js:64 f
    [amacss_frontend]/[webpack]/lib/index.js:64:16

  - bundle.ts:7 build
    [amacss_frontend]/[gatsby]/src/utils/webpack/bundle.ts:7:20

  - build-html.ts:192 
    [amacss_frontend]/[gatsby]/src/commands/build-html.ts:192:7

  - new Promise

  - build-html.ts:141 runWebpack
    [amacss_frontend]/[gatsby]/src/commands/build-html.ts:141:10

  - build-html.ts:207 doBuildRenderer
    [amacss_frontend]/[gatsby]/src/commands/build-html.ts:207:34

  - build-html.ts:251 buildRenderer
    [amacss_frontend]/[gatsby]/src/commands/build-html.ts:251:10

  - start-server.ts:102 createIndexHtml
    [amacss_frontend]/[gatsby]/src/utils/start-server.ts:102:39

  - start-server.ts:142 startServer
    [amacss_frontend]/[gatsby]/src/utils/start-server.ts:142:5

  - start-webpack-server.ts:38 startWebpackServer
    [amacss_frontend]/[gatsby]/src/services/start-webpack-server.ts:38:5


not finished Building development bundle - 0.808s

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I tried running yarn install, yarn upgrade, then yarn dev and run an existing website that I just inherited and have no background knowledge of Gatsby or React but it will not run.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Kat B
  • 1
  • 3
  • Are you sure the config is correct? It seems like there is incorrect syntax in your gatsby.config.js file. If its breaking on `rules`, downgrade or use the correct syntax. [See stackoverflow answer..](https://stackoverflow.com/questions/68984336/webpack-error-configuration-module-rules0-has-an-unknown-property-query) – treckstar Nov 03 '22 at 06:04
  • This seemed to be the problem. I ended up deleting the node_modules, going back to the original settings, and trying to config there, but I now have a different issue with a print line somehow? – Kat B Nov 04 '22 at 13:27

0 Answers0