gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

`gatsby build` returns duplicated output in console on Gatsby V4 #34314

Closed rootkowsky closed 2 years ago

rootkowsky commented 2 years ago

Preliminary Checks

Description

New Gatsby v4 project (created via npx gatsby new <project_name>), on gatsby build process returns duplicated(?) output in console. Below collapsed sample output.

My console output ``` ➜ gatsby-duplicated-output git:(master) ✗ npm run build > gatsby-starter-default@0.1.0 build /Users/krzysztofpogwizd/dev/gatsby-duplicated-output > gatsby build success open and validate gatsby-configs, load plugins - 1.671s success onPreInit - 0.007s success initialize cache - 0.533s success copy gatsby files - 0.053s success Compiling Gatsby Functions - 0.252s success onPreBootstrap - 0.260s success createSchemaCustomization - 0.012s success Checking for changed pages - 0.001s success source and transform nodes - 0.099s info Writing GraphQL type definitions to /Users/krzysztofpogwizd/dev/gatsby-duplicated-output/.cache/schema.gql success building schema - 0.592s success createPages - 0.016s success createPagesStatefully - 0.088s info Total nodes: 43, SitePage nodes: 7 (use --verbose for breakdown) success Checking for changed pages - 0.001s success onPreExtractQueries - 0.001s success extract queries from components - 2.508s success write out redirect data - 0.026s success Build manifest and related icons - 0.487s success onPostBootstrap - 0.514s info bootstrap finished - 8.760s success write out requires - 0.005s success Building production JavaScript and CSS bundles - 6.750s success Building Rendering Engines - 20.603s success Building HTML renderer - 3.849s success Execute page configs - 0.014s success Validating Rendering Engines - 2.576s success Caching Webpack compilations - 0.002s success run queries in workers - 0.087s - 7/7 80.20/s success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 34.578s - 3/3 0.09/s success Merge worker state - 0.002s success Rewriting compilation hashes - 0.003s success Writing page-data.json files to public directory - 0.011s - 5/7 644.29/s success Building static HTML for pages - 2.255s - 5/5 2.22/s success onPostBuild - 0.001s success open and validate gatsby-configs, load plugins - 1.671s success onPreInit - 0.007s success initialize cache - 0.533s success copy gatsby files - 0.053s success Compiling Gatsby Functions - 0.252s success onPreBootstrap - 0.260s success createSchemaCustomization - 0.012s success Checking for changed pages - 0.001s success source and transform nodes - 0.099s info Writing GraphQL type definitions to /Users/krzysztofpogwizd/dev/gatsby-duplicated-output/.cache/schema.gql success building schema - 0.592s success createPages - 0.016s success createPagesStatefully - 0.088s info Total nodes: 43, SitePage nodes: 7 (use --verbose for breakdown) success Checking for changed pages - 0.001s success onPreExtractQueries - 0.001s success extract queries from components - 2.508s success write out redirect data - 0.026s success Build manifest and related icons - 0.487s success onPostBootstrap - 0.514s info bootstrap finished - 8.760s success write out requires - 0.005s success Building production JavaScript and CSS bundles - 6.750s success Building Rendering Engines - 20.603s success Building HTML renderer - 3.849s success Execute page configs - 0.014s success Validating Rendering Engines - 2.576s success Caching Webpack compilations - 0.002s success run queries in workers - 0.087s - 7/7 80.20/s success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 34.578s - 3/3 0.09/s success Merge worker state - 0.002s success Rewriting compilation hashes - 0.003s success Writing page-data.json files to public directory - 0.011s - 5/7 644.29/s success Building static HTML for pages - 2.255s - 5/5 2.22/s success onPostBuild - 0.001s Pages ┌ src/templates/using-dsg.js │ └ D /using-dsg ├ src/pages/404.js │ ├ /404/ │ └ /404.html ├ src/pages/index.js │ └ / ├ src/pages/page-2.js │ └ /page-2/ ├ src/pages/using-ssr.js │ └ ∞ /using-ssr/ └ src/pages/using-typescript.tsx └ /using-typescript/ ╭────────────────────────────────────────────────────────────────╮ │ │ │ (SSG) Generated at build time │ │ D (DSG) Deferred static generation - page generated at runtime │ │ ∞ (SSR) Server-side renders at runtime (uses getServerData) │ │ λ (Function) Gatsby function │ │ │ ╰────────────────────────────────────────────────────────────────╯ success open and validate gatsby-configs, load plugins - 1.671s success onPreInit - 0.007s success initialize cache - 0.533s success copy gatsby files - 0.053s success Compiling Gatsby Functions - 0.252s success onPreBootstrap - 0.260s success createSchemaCustomization - 0.012s success Checking for changed pages - 0.001s success source and transform nodes - 0.099s info Writing GraphQL type definitions to /Users/krzysztofpogwizd/dev/gatsby-duplicated-output/.cache/schema.gql success building schema - 0.592s success createPages - 0.016s success createPagesStatefully - 0.088s info Total nodes: 43, SitePage nodes: 7 (use --verbose for breakdown) success Checking for changed pages - 0.001s success onPreExtractQueries - 0.001s success extract queries from components - 2.508s success write out redirect data - 0.026s success Build manifest and related icons - 0.487s success onPostBootstrap - 0.514s info bootstrap finished - 8.760s success write out requires - 0.005s success Building production JavaScript and CSS bundles - 6.750s success Building Rendering Engines - 20.603s success Building HTML renderer - 3.849s success Execute page configs - 0.014s success Validating Rendering Engines - 2.576s success Caching Webpack compilations - 0.002s success run queries in workers - 0.087s - 7/7 80.20/s success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 34.578s - 3/3 0.09/s success Merge worker state - 0.002s success Rewriting compilation hashes - 0.003s success Writing page-data.json files to public directory - 0.011s - 5/7 644.29/s success Building static HTML for pages - 2.255s - 5/5 2.22/s success onPostBuild - 0.001s info Done building in 46.334514708 sec Pages ┌ src/templates/using-dsg.js │ └ D /using-dsg ├ src/pages/404.js │ ├ /404/ │ └ /404.html ├ src/pages/index.js │ └ / ├ src/pages/page-2.js │ └ /page-2/ ├ src/pages/using-ssr.js │ └ ∞ /using-ssr/ └ src/pages/using-typescript.tsx └ /using-typescript/ ╭────────────────────────────────────────────────────────────────╮ │ │ │ (SSG) Generated at build time │ │ D (DSG) Deferred static generation - page generated at runtime │ │ ∞ (SSR) Server-side renders at runtime (uses getServerData) │ │ λ (Function) Gatsby function │ │ │ ╰────────────────────────────────────────────────────────────────╯ success open and validate gatsby-configs, load plugins - 1.671s success onPreInit - 0.007s success initialize cache - 0.533s success copy gatsby files - 0.053s success Compiling Gatsby Functions - 0.252s success onPreBootstrap - 0.260s success createSchemaCustomization - 0.012s success Checking for changed pages - 0.001s success source and transform nodes - 0.099s info Writing GraphQL type definitions to /Users/krzysztofpogwizd/dev/gatsby-duplicated-output/.cache/schema.gql success building schema - 0.592s success createPages - 0.016s success createPagesStatefully - 0.088s info Total nodes: 43, SitePage nodes: 7 (use --verbose for breakdown) success Checking for changed pages - 0.001s success onPreExtractQueries - 0.001s success extract queries from components - 2.508s success write out redirect data - 0.026s success Build manifest and related icons - 0.487s success onPostBootstrap - 0.514s info bootstrap finished - 8.760s success write out requires - 0.005s success Building production JavaScript and CSS bundles - 6.750s success Building Rendering Engines - 20.603s success Building HTML renderer - 3.849s success Execute page configs - 0.014s success Validating Rendering Engines - 2.576s success Caching Webpack compilations - 0.002s success run queries in workers - 0.087s - 7/7 80.20/s success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 34.578s - 3/3 0.09/s success Merge worker state - 0.002s success Rewriting compilation hashes - 0.003s success Writing page-data.json files to public directory - 0.011s - 5/7 644.29/s success Building static HTML for pages - 2.255s - 5/5 2.22/s success onPostBuild - 0.001s info Done building in 46.334514708 sec Pages ┌ src/templates/using-dsg.js │ └ D /using-dsg ├ src/pages/404.js │ ├ /404/ │ └ /404.html ├ src/pages/index.js │ └ / ├ src/pages/page-2.js │ └ /page-2/ ├ src/pages/using-ssr.js │ └ ∞ /using-ssr/ └ src/pages/using-typescript.tsx └ /using-typescript/ ╭────────────────────────────────────────────────────────────────╮ │ │ │ (SSG) Generated at build time │ │ D (DSG) Deferred static generation - page generated at runtime │ │ ∞ (SSR) Server-side renders at runtime (uses getServerData) │ │ λ (Function) Gatsby function │ │ │ ╰────────────────────────────────────────────────────────────────╯ success open and validate gatsby-configs, load plugins - 1.671s success onPreInit - 0.007s success initialize cache - 0.533s success copy gatsby files - 0.053s success Compiling Gatsby Functions - 0.252s success onPreBootstrap - 0.260s success createSchemaCustomization - 0.012s success Checking for changed pages - 0.001s success source and transform nodes - 0.099s info Writing GraphQL type definitions to /Users/krzysztofpogwizd/dev/gatsby-duplicated-output/.cache/schema.gql success building schema - 0.592s success createPages - 0.016s success createPagesStatefully - 0.088s info Total nodes: 43, SitePage nodes: 7 (use --verbose for breakdown) success Checking for changed pages - 0.001s success onPreExtractQueries - 0.001s success extract queries from components - 2.508s success write out redirect data - 0.026s success Build manifest and related icons - 0.487s success onPostBootstrap - 0.514s info bootstrap finished - 8.760s success write out requires - 0.005s success Building production JavaScript and CSS bundles - 6.750s success Building Rendering Engines - 20.603s success Building HTML renderer - 3.849s success Execute page configs - 0.014s success Validating Rendering Engines - 2.576s success Caching Webpack compilations - 0.002s success run queries in workers - 0.087s - 7/7 80.20/s success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 34.578s - 3/3 0.09/s success Merge worker state - 0.002s success Rewriting compilation hashes - 0.003s success Writing page-data.json files to public directory - 0.011s - 5/7 644.29/s success Building static HTML for pages - 2.255s - 5/5 2.22/s success onPostBuild - 0.001s info Done building in 46.334514708 sec Pages ┌ src/templates/using-dsg.js │ └ D /using-dsg ├ src/pages/404.js │ ├ /404/ │ └ /404.html ├ src/pages/index.js │ └ / ├ src/pages/page-2.js │ └ /page-2/ ├ src/pages/using-ssr.js │ └ ∞ /using-ssr/ └ src/pages/using-typescript.tsx └ /using-typescript/ ╭────────────────────────────────────────────────────────────────╮ │ │ │ (SSG) Generated at build time │ │ D (DSG) Deferred static generation - page generated at runtime │ │ ∞ (SSR) Server-side renders at runtime (uses getServerData) │ │ λ (Function) Gatsby function │ │ │ ╰────────────────────────────────────────────────────────────────╯ ➜ gatsby-duplicated-output git:(master) ✗ ```

Reproduction Link

https://github.com/rootkowsky/gatsby-duplicated-output

Steps to Reproduce

  1. npx gatsby new gatsby-duplicated-output
  2. cd gatsby-duplicated-output
  3. npm run build
  4. Find out, that output in console is duplicated several times.

Expected Result

Output in console is not duplicated

Actual Result

Output in console is duplicated

Environment

System:
    OS: macOS 12.0.1
    CPU: (8) x64 Apple M1
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
    Yarn: 1.22.10 - /opt/homebrew/bin/yarn
    npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
  Languages:
    Python: 2.7.18 - /usr/bin/python
  Browsers:
    Chrome: 96.0.4664.110
    Edge: 96.0.1054.62
    Safari: 15.1
  npmPackages:
    gatsby: ^4.4.0 => 4.4.0 
    gatsby-plugin-gatsby-cloud: ^4.4.0 => 4.4.0 
    gatsby-plugin-image: ^2.4.0 => 2.4.0 
    gatsby-plugin-manifest: ^4.4.0 => 4.4.0 
    gatsby-plugin-offline: ^5.4.0 => 5.4.0 
    gatsby-plugin-react-helmet: ^5.4.0 => 5.4.0 
    gatsby-plugin-sharp: ^4.4.0 => 4.4.0 
    gatsby-source-filesystem: ^4.4.0 => 4.4.0 
    gatsby-transformer-sharp: ^4.4.0 => 4.4.0

Config Flags

No response

tyhopp commented 2 years ago

Hi @rootkowsky, thanks for the description.

I wasn't able to reproduce this on Node v14.18.2 (output is not duplicated). With your version (Node v14.16.1) I encountered an M1 issue that is likely unrelated. Are you running this natively or with Rosetta?

Do you also experience this on subsequent builds or with different Node versions on your machine?

rootkowsky commented 2 years ago

Hi @tyhopp

Yesterday I've realized that this is an issue that occurs only on the WebStorm IDE terminal 😐 On iTerm2 everything is OK

tyhopp commented 2 years ago

I see, I gave that a try since I happened to have IntelliJ installed and it only happens in their terminal if I have it attached (detached and full size no duplication). Looks like an IntelliJ issue.

LekoArts commented 2 years ago

Thanks both for triaging this! @rootkowsky with this information in mind I'd be inclined to close this issue for now. One thing you could try setting the GATSBY_LOGGER env var to yurnalist to see if it's a problem with ink, e.g. GATSBY_LOGGER=yurnalist gatsby build

misterorion commented 2 years ago

Was seeing the duplicated content in my build logs on Google Cloud Build.

Adding GATSBY_LOGGER=yurnalist to my env vars seems to have resolved it.

github-actions[bot] commented 2 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

github-actions[bot] commented 2 years ago

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜