pasdo501 / gatsby-source-woocommerce

Gatsy Source Plugin for WooCommerce
34 stars 14 forks source link

Infinite loop when installing #40

Closed iamalexm closed 1 year ago

iamalexm commented 2 years ago

I get an infinite loop while installing the package :

npm install --save @pasdo501/gatsby-source-woocommerce --verbose

npm http fetch GET 200 https://registry.npmjs.org/@hapi%2Faddress 1418ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/url-to-options 1354ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/connect-history-api-fallback 1425ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/serve-index 1538ms (cache revalidated)
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 38ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 25ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 29ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 23ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 24ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 24ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 23ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 23ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 24ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 25ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 24ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 23ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 24ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 21ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 25ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 24ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 26ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 23ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 28ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 21ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 25ms
npm timing idealTree:node_modules/@pasdo501/gatsby-source-woocommerce Completed in 22ms
...
...
...
never ending

My package.json file

{
  "name": "xxx",
  "version": "1.0.0",
  "private": true,
  "description": "xxx",
  "author": "Alex",
  "keywords": [
    "gatsby"
  ],
  "scripts": {
    "develop": "gatsby develop",
    "start": "gatsby develop",
    "build": "gatsby build",
    "serve": "gatsby serve",
    "clean": "gatsby clean",
    "typecheck": "tsc --noEmit"
  },
  "dependencies": {
    "gatsby": "^4.24.7",
    "gatsby-plugin-image": "^2.24.0",
    "gatsby-plugin-sharp": "^4.24.0",
    "gatsby-source-filesystem": "^4.24.0",
    "gatsby-source-wordpress": "^6.24.0",
    "gatsby-transformer-sharp": "^4.24.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@types/node": "^18.11.9",
    "@types/react": "^18.0.25",
    "@types/react-dom": "^18.0.8",
    "@woocommerce/woocommerce-rest-api": "^1.0.1",
    "autoprefixer": "^10.4.13",
    "gatsby-plugin-postcss": "^5.24.0",
    "postcss": "^8.4.18",
    "tailwindcss": "^3.2.2",
    "typescript": "^4.8.4"
  }
}
pasdo501 commented 1 year ago

Hi @iamalexm --

Apologies for the delay. I'm not sure if you're still even using this at all or just moved on, but I did get around to having a look at this. From what I can tell, the issue is somehow related to the gatsby-source-filesystem dependency of the plugin.

I don't quite understand exactly what's going on, but I've tried upping the version of that dependency, which seems to have solved the issue - at least I was able to install the plugin into your sample package.json file, where I couldn't before (was seeing the same issue as you, in fact even with a completely blank package.json it was getting into that loop when trying to npm install the plugin).

Interestingly, this only happened with npm; yarn didn't encounter the same issue.

iamalexm commented 1 year ago

Hi @pasdo501,

Thanks for taking the time to check my issue. I moved on but I'm still going to try to update the dependency version like you did.