简体   繁体   中英

Is there any way to show warnings when Gatsby develop/build?

I am working on a gatsby project using React. I was able to see all the warnings when gatsby develop or gatsby build but the console doesn't show the warnings anymore. I haven't changed any settings related to this. Does anyone know how to solve this? Thank you.

console when gatsby build

Well, you should have changed anything. Could be anything related to the ESLint configuration.

If you run gatsby --help (or gatsby -h ) in the root of your project you'll see all the available commands, what should look like:

  gatsby develop                      Start development server. Watches files, rebuilds, and hot reloads if something changes
  gatsby build                        Build a Gatsby project.
  gatsby serve                        Serve previously built Gatsby site.
  gatsby info                         Get environment information for debugging and issue reporting
  gatsby clean                        Wipe the local gatsby environment including built assets and cache
  gatsby repl                         Get a node repl with context of Gatsby environment, see
                                      (https://www.gatsbyjs.com/docs/gatsby-repl/)
  gatsby recipes [recipe]             [EXPERIMENTAL] Run a recipe
  gatsby plugin <cmd> [plugins...]    Useful commands relating to Gatsby plugins
  gatsby new [rootPath] [starter]     Create new Gatsby project.
  gatsby telemetry                    Enable or disable Gatsby anonymous analytics collection.
  gatsby options [cmd] [key] [value]  View or set your gatsby-cli configuration settings.

Options:
  --verbose                Turn on verbose output                                                       [boolean] [default: false]
  --no-color, --no-colors  Turn off the color in output                                                 [boolean] [default: false]
  --json                   Turn on the JSON logger                                                      [boolean] [default: false]
  -h, --help               Show help                                                                                     [boolean]
  -v, --version            Show the version of the Gatsby CLI and the Gatsby package in the current project              [boolean]

So, you can run:

gatsby develop --verbose

To turn on the verbose output and see the detailed logs.

As I said, you need to distinguish between the browser's log and the Node terminal log, some logs (client-side ones) will be prompted by the browser, regarding all stuff about React and JavaScript. While some other (server-side logs) will be only prompted by the terminal, those refer to the stuff related to Node, GraphQL, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM