gatsby: Gatsby develop stuck on Windows 10

Hello guys. I used Solus OS (linux) and gatsby worked just fine without any problem. Now I’m using Windows 10 (x64). Everything I type “gatsby develop” the first time after turning on my computer, it stucks right here:

success write out requires - 0.116s
success write out redirect data - 0.016s
⠋ onPostBootstrap
⠋ Build manifest and related icons

And I have to Ctrl+C and then “gatsby develop” again and it works. Always stucks at the first time.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 21
  • Comments: 35 (9 by maintainers)

Most upvoted comments

I’ve been facing the same issue on Windows (stuck on onPostBootstrap & Build manifest and related icons), but largely ignore it because I just hit Ctrl+C and run it again (which works all the time). I am using an svg instead of a png for the icon. It is not a big deal, but kinda annoying since I have to hit Ctrl+C to get it to work in dev.

gatsby-config.js

    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        ...
        icon: `src/imgs/icons/laptop-color.svg`,
      },
    },
    `gatsby-plugin-offline`, // Note: list this plugin after gatsby-plugin-manifest

output:

$  yarn start
yarn run v1.22.10
$ gatsby clean
info Deleting .cache, public, C:\dev\paulkode.com\node_modules\.cache\babel-loader, C:\dev\paulkode.com\node_modules\.cache\terser-webpack-plugin
info Successfully deleted directories

$ gatsby develop --host=0.0.0.0 --port=4242 --open
success open and validate gatsby-configs - 0.074s
success load plugins - 0.679s
success onPreInit - 0.037s
success initialize cache - 0.008s
success copy gatsby files - 0.132s
success onPreBootstrap - 0.033s
success createSchemaCustomization - 0.003s
success Checking for changed pages - 0.002s
success source and transform nodes - 0.066s
success building schema - 0.216s
info Total nodes: 30, SitePage nodes: 1 (use --verbose for breakdown)
success createPages - 0.004s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.158s
success update schema - 0.022s
success write out redirect data - 0.002s
⠇ onPostBootstrap
⠇ Build manifest and related icons

Hello guys. I used Solus OS (linux) and gatsby worked just fine without any problem. Now I’m using Windows 10 (x64). Everything I type “gatsby develop” the first time after turning on my computer, it stucks right here:

success write out requires - 0.116s
success write out redirect data - 0.016s
⠋ onPostBootstrap
⠋ Build manifest and related icons

And I have to Ctrl+C and then “gatsby develop” again and it works. Always stucks at the first time.

My solution was;

  1. Update the gatsby-cli and nodejs if possible.

  2. Remove the node_modules, .cache, the public folder and the yarn.lock or package-lock.json files.

  3. I believe the sharp or the pngquant libraries need some processing power to compress your images and icons, to free some resources you could kills some apps or processes running on your machine using Task manager on Windows OS, for example Google Chrome or any other apps consuming resources on your CPU and Memory then try to run yarn install and gatsby develop and it did worked for me.

This issue is driving me crazy, two thirds of my attempts to do gatsby build o develop end ups stuck just like this.

⠋ onPostBootstrap
⠋ Build manifest and related icons

Commenting out the SVG icon for the manifest plugin fixes this issue, but I need it for production builds.

Seems to happen on Windows 10 but not on Ubuntu server 🤷

Hello guys. I used Solus OS (linux) and gatsby worked just fine without any problem. Now I’m using Windows 10 (x64). Everything I type “gatsby develop” the first time after turning on my computer, it stucks right here:

success write out requires - 0.116s
success write out redirect data - 0.016s
⠋ onPostBootstrap
⠋ Build manifest and related icons

And I have to Ctrl+C and then “gatsby develop” again and it works. Always stucks at the first time.

My solution was;

  1. Update the gatsby-cli and nodejs if possible.
  2. Remove the node_modules, .cache, the public folder and the yarn.lock or package-lock.json files.
  3. I believe the sharp or the pngquant libraries need some processing power to compress your images and icons, to free some resources you could kills some apps or processes running on your machine using Task manager on Windows OS, for example Google Chrome or any other apps consuming resources on your CPU and Memory then try to run yarn install and gatsby develop and it did worked for me.

This solution helped me also. I updated gatsby-cli, removed the node_modules, .cache, public folders and the package-lock.json file. After that I ran a clean npm install.

I can confirm that I no longer see this issue happening after upgrading to the latest version. Thank you!

I have been dealing with this issue from day one of using Gatsby. No matter what starter or theme I use, the same thing always happens to me.

Any solution?

I’ve also had this issue, but via gatsby build, not just via gatsby develop as the issue says, just in case the ‘develop’ bit is a red herring for someone looking into this. The workaround of pressing a key to ‘flush’ the console doesn’t work in my case I’m using a vscode task.

For me this workaround from issue #31878 works. I was hoping it was fixed in the latest version of Gatsby, but the problem just moved from production build to development build.

// gatsby-node.js
// TODO: temporary workaround for https://github.com/gatsbyjs/gatsby/issues/31878
exports.onCreateWebpackConfig = ({ actions, plugins, stage, getConfig }) => {
  // override config only during production JS & CSS build
  if (stage === "build-javascript") {
    // get current webpack config
    const config = getConfig();

    const options = {
      minimizerOptions: {
        preset: [
          `default`,
          {
            svgo: {
              full: true,
              plugins: [
                // potentially destructive plugins removed - see https://github.com/gatsbyjs/gatsby/issues/15629
                // use correct config format and remove plugins requiring specific params - see https://github.com/gatsbyjs/gatsby/issues/31619
                `removeUselessDefs`,
                `cleanupAttrs`,
                `cleanupEnableBackground`,
                `cleanupIDs`,
                `cleanupListOfValues`,
                `cleanupNumericValues`,
                `collapseGroups`,
                `convertColors`,
                `convertPathData`,
                `convertStyleToAttrs`,
                `convertTransform`,
                `inlineStyles`,
                `mergePaths`,
                `minifyStyles`,
                `moveElemsAttrsToGroup`,
                `moveGroupAttrsToElems`,
                `prefixIds`,
                `removeAttrs`,
                `removeComments`,
                `removeDesc`,
                // `removeDimensions`,
                `removeDoctype`,
                `removeEditorsNSData`,
                `removeEmptyAttrs`,
                `removeEmptyContainers`,
                `removeEmptyText`,
                `removeHiddenElems`,
                `removeMetadata`,
                `removeNonInheritableGroupAttrs`,
                `removeOffCanvasPaths`,
                `removeRasterImages`,
                `removeScriptElement`,
                `removeStyleElement`,
                `removeTitle`,
                `removeUnknownsAndDefaults`,
                `removeUnusedNS`,
                `removeUselessStrokeAndFill`,
                `removeXMLProcInst`,
                `reusePaths`,
                `sortAttrs`,
              ],
            },
          },
        ],
      },
    };
    // find CSS minimizer
    const minifyCssIndex = config.optimization.minimizer.findIndex(
      (minimizer) => minimizer.constructor.name === "CssMinimizerPlugin"
    );
    // if found, overwrite existing CSS minimizer with the new one
    if (minifyCssIndex > -1) {
      config.optimization.minimizer[minifyCssIndex] =
        plugins.minifyCss(options);
    }
    // replace webpack config with the modified object
    actions.replaceWebpackConfig(config);
  }
};

Steps to reproduce

  1. Installed the package gatsby-source-gitlab-api
  2. Added it to my gatsby-config.js file
  3. Run gatsby develop

Result

...

success initialize cache - 0.040s
success copy gatsby files - 0.156s
success Compiling Gatsby Functions - 0.400s
success onPreBootstrap - 0.435s
success createSchemaCustomization - 0.083s
⠇ source and transform nodes

Environment

  • OS: Windows 10 x64 20H2 19042.1100
  • Shell: CMD 10.0.19042.1110
  • Node: 14.15.1
  • Yarn: 1.22.5

yarn.lock

...

gatsby-source-gitlab-api@^1.0.5:
  version "1.0.5"
  resolved "https://registry.yarnpkg.com/gatsby-source-gitlab-api/-/gatsby-source-gitlab-api-1.0.5.tgz#0734ab542c235b149740b42e766f34e803afddfb"
  integrity sha512-vVs4SvkGgY2xaJZWsfaxUy33vRcOArhJtdHcei2i8tHTyleRdr8OYr8nVbTG9Yg829uHSFySC5x/VBEfAPNQcg==
  dependencies:
    "@gitbeaker/browser" "^28.0.4"
    "@gitbeaker/cli" "^28.0.4"
    "@gitbeaker/node" "^28.0.4"

...

package.json

...

  "dependencies": {
    "gatsby": "^3.8.0",
    "gatsby-image": "^3.8.0",
    "gatsby-plugin-google-analytics": "^3.8.0",
    "gatsby-plugin-manifest": "^3.8.0",
    "gatsby-plugin-offline": "^4.8.0",
    "gatsby-plugin-react-helmet": "^4.8.0",
    "gatsby-plugin-sharp": "^3.8.0",
    "gatsby-plugin-styled-components": "^4.8.0",
    "gatsby-remark-copy-linked-files": "^4.5.0",
    "gatsby-remark-images": "^5.5.0",
    "gatsby-remark-prismjs": "^5.5.0",
    "gatsby-remark-responsive-iframe": "^4.5.0",
    "gatsby-remark-smartypants": "^4.5.0",
    "gatsby-source-filesystem": "^3.8.0",
    "gatsby-source-github-api": "^1.0.0",
    "gatsby-source-gitlab-api": "^1.0.5",
    "gatsby-transformer-remark": "^4.5.0",
    "gatsby-transformer-sharp": "^3.8.0",
    "node-sass": "^6.0.1",
    "prismjs": "^1.20.0",
    "prop-types": "^15.7.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-github-btn": "^1.2.0",
    "react-github-button": "^0.1.11",
    "react-helmet": "^6.1.0",
    "react-icons": "^4.2.0",
    "sharp": "^0.28.3",
    "styled-components": "^5.1.1"
  },
  "devDependencies": {
    "prettier": "2.3.2"
  },
  "resolutions": {
    "graphql": "^15.4.0",
    "graphql-compose": "^9.0.2",
    "webpack": "^5.24.2"
  },

...

What I’ve tried

  • gatsby clean
  • Deleting .cache dir
  • Deleting public dir
  • Deleting node_modules dir
  • Deleting yarn.lock file
  • Reinstalling packages
  • Resizing my terminal window (? weirdly something that seemed to work for some)

References: @28development/gatsby-source-gitlab-api#1, @gatsbyjs/gatsby#17131, @gatsbyjs/gatsby#28632

I am also getting the issue Running on node 15.5 & Windows 10 20H2 Gatsby 2.30.1 & 2.30.

For me, the issue seems to disappear if I choose a png as a source file instead of an svg

@moonmeister Looked good yesterday after updating to gatsby@2.30.1. But today I’ve had a change in gatsby-config.js and am experiencing the issue again unfortunately.

gatsby develop stalls on onPostBootstrap/Build manifest and related icons in first build after config-change. Killing the process and re-issuing the command runs successfully to the end. Which is how it’s always been for me.

edit: It does not happen after every config change though, so I can’t reliably reproduce it.

same here

Latest Gatsby(v2.30) updated to ink@v3. I’m curios if anyone could update and test to see if this has resolved the issue.

I’ll give it a test over the next few days. I have updated all my packages now and done a gatsby clean.

Latest Gatsby(v2.30) updated to ink@v3. I’m curios if anyone could update and test to see if this has resolved the issue.

I have been dealing with this issue from day one of using Gatsby. No matter what starter or theme I use, the same thing always happens to me.

Any solution?

Exactly the same for me. Would also like some solution for this (although it doesn’t seem mission critical at this point as this only happens on my development Windows machine and not in my CI, so my production release cycle is not affected in any way).