Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gatsby develop stuck on Windows 10 #25216

Closed
mimiza opened this issue Jun 23, 2020 · 35 comments · Fixed by #34331
Closed

Gatsby develop stuck on Windows 10 #25216

mimiza opened this issue Jun 23, 2020 · 35 comments · Fixed by #34331
Assignees
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins type: bug An issue or pull request relating to a bug in Gatsby

Comments

@mimiza
Copy link

mimiza commented Jun 23, 2020

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.

@mimiza mimiza added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 23, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 23, 2020
@madalynrose
Copy link
Contributor

Hi @mimiza!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Additionally, it would be helpful to know more about your environment (e.g. which terminal application you are using, which editor, etc.) in order to help locate the bug.

Thanks for using Gatsby! 💜

@madalynrose madalynrose added status: needs more info Needs triaging and reproducible examples or more information to be resolved status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 23, 2020
@mimiza
Copy link
Author

mimiza commented Jun 24, 2020

@madalynrose Hi there!
Please clone this repo https://github.com/mimiza/mimiza.com
I'm using Windows 10 (x64), my editor is VSCode.
Thank you so much for your response.

@wardpeet wardpeet added topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins and removed status: needs more info Needs triaging and reproducible examples or more information to be resolved status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. labels Jun 24, 2020
@wardpeet
Copy link
Contributor

Hey @mimiza.

I could reproduce this one but I don't really know the reason why this happens. Maybe it's the svg 🤷
When I add console.log inside the plugin, everything works as expected.

@moonmeister do you know of any race conditions that can occur here?

@moonmeister moonmeister assigned wardpeet and unassigned moonmeister Jun 24, 2020
@moonmeister
Copy link
Contributor

I'm not aware of anything off hand but possible. Maybe file system related too. If I get a chance I'll do some testing now that I have a windows machine.

@mimiza
Copy link
Author

mimiza commented Jul 7, 2020

@wardpeet @moonmeister thank you for supporting. But if it was about svg, why would Linux work?

@moonmeister

This comment has been minimized.

@MeilleurExcellentOptimal

I have exactly the same issue as @mimiza.

@moonmeister
Copy link
Contributor

SInce my initial testing I've been doing more windows dev and run into this issue as well. I'm not convinced the bug is in gatsby-source-manifest but that is where it seems to pause consistently. While subsequent runs seem slightly more consistent for me, it seems to hang randomly.

@moonmeister moonmeister added the status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. label Jul 21, 2020
@ediblecode
Copy link
Contributor

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.

@dkocich
Copy link

dkocich commented Aug 28, 2020

This issue happened to me while I used default starter, removed gatsby-icon.png from the project, used my own icon but did not change it in gatsby-config.js (settings of ... resolve: gatsby-plugin-manifest, options { src: 'src/images/myNewIcon-icon.jpg'}...)

@edardev
Copy link

edardev commented Sep 9, 2020

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.

@jordan-git
Copy link

jordan-git commented Sep 26, 2020

This is happening to me now too. Repository. It started happening a little before my current commit, but I was able to get around it by running the command again so I kept working. My page seems to have gotten slower and to the point where the JS breaks with my most recent addition so I'm going to have to look in to if that is something I caused but I'm too tired to do that tonight.
Link to hosted page that is breaking for me after a few navigates or on load

@jordan-git
Copy link

jordan-git commented Sep 26, 2020

It seems the problem was my Node not being up to date. I was able to develop my site fine up until some point where this started happening. Updating Node fixed that issue. I fixed my other issue also.

@eliooses-zondax
Copy link

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?

@maulerjan
Copy link

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).

@OddBlueDog
Copy link

Same issue here, I have been pressing ctrl + c. On Windows 10, gatsby-cli 2.17.0, and node 14.15.3

@moonmeister
Copy link
Contributor

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.

@OddBlueDog
Copy link

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.

@maulerjan
Copy link

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

@mahmoudmiz
Copy link

same here

@henrik-m
Copy link

henrik-m commented Jan 7, 2021

@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.

@moonmeister
Copy link
Contributor

moonmeister commented Jan 7, 2021 via email

@henrik-m
Copy link

henrik-m commented Jan 7, 2021

I added a require to another (dependency-less) JS file containing additional config variables. I used them to change a few options for the plugin gatsby-plugin-google-marketing-platform. I would be suprised if the particular change mattered though.

I undid and redid the changes, did a production build in between, but have not been able to reproduce the issue yet. It seems to have been a "first build of the day" thing so far. So the situation has definitely improved. I was getting this a lot more often in the past.

@artdiev
Copy link

artdiev commented Jan 13, 2021

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

@OddBlueDog
Copy link

I think it's better, sometimes you do just have to wait a bit for the re-building to happen around 10s for minor CSS changes.

@kimbaudi
Copy link
Contributor

kimbaudi commented Feb 6, 2021

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

@fayzanx
Copy link

fayzanx commented Mar 12, 2021

I am also facing the same issue when trying to run gatsby develop on Windows 10 using node v12.16.3, gatsby-cli v2.19.2 and gatsby v2.32.11

I've tried almost all of the fixes suggested above, but still facing the issue.

Also, in my case the process is stuck at onPreBootstrap.

@eightbit
Copy link

Same issue here - develop fails the first time, then runs after ctrl-c.
Subscribing to this thread. Happy to help if you need info about my config or versions.
Thx.

@jacobabiola
Copy link

i am have in the same issue

C:\Users\user\codes\startr-homepage>gatsby develop
success open and validate gatsby-configs - 3.508s
success load plugins - 82.187s
success onPreInit - 0.984s
success initialize cache - 0.705s
success copy gatsby files - 8.100s
success onPreBootstrap - 0.675s
success createSchemaCustomization - 0.081s
success Checking for changed pages - 0.013s
success source and transform nodes - 2.290s
success building schema - 4.693s
info Total nodes: 74, SitePage nodes: 1 (use --verbose for breakdown)
success createPages - 0.024s
success Checking for changed pages - 0.019s
success createPagesStatefully - 1.485s
success update schema - 0.701s
success write out redirect data - 0.016s
⠋ onPostBootstrap
⠏ Build manifest and related icons

@MartSurv
Copy link

MartSurv commented May 2, 2021

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.

@ownchoice
Copy link

ownchoice commented May 20, 2021

I'm having the same problem on Windows 10, but it doesn't always happen. Sometimes it does, sometimes it doesn't.
Even deleting .cache, node_modules, public and package-lock.json and updating gatsby-cli doesn't seem to fix it or to make it consistent.

But what does fix it is commenting out this code block of the gatsby-config.js file:

{
  resolve: 'gatsby-plugin-manifest',
  options: {
    name: config.siteTitle,
    short_name: config.siteTitleShort,
    description: config.siteDescription,
    start_url: validatedPathPrefix,
    background_color: config.backgroundColor,
    theme_color: config.themeColor,
    display: 'minimal-ui',
    icon: 'static/favicon.svg'
  }
},

@alexjorgef
Copy link

alexjorgef commented Aug 3, 2021

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

@ownchoice
Copy link

ownchoice commented Sep 26, 2021

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 🤷

@kdoroszewicz
Copy link

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);
  }
};

@justinsane98
Copy link

justinsane98 commented Oct 24, 2021

I was still running into this issue this morning and I simply renamed the svg file and updated the reference in the manifest and it has completely resolved the issue. Why this resolves the issue? No clue... but it does work 100% of the time now when I was previously deploying with less than a 50% success rate. Hopefully this will help folks figure out the underlying issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: plugins-PWA Issues related to PWA: the gatsby-plugin-offline and gatsby-plugin-manifest plugins type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.