stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.92k stars 170 forks source link

BUG: HttpError: Failed to fetch dependencies #99

Closed critesjosh closed 1 year ago

critesjosh commented 3 years ago

name: Bug report about: Create a report to help us improve title: 'HttpError: Failed to fetch dependencies' labels: '' assignees: ''


Describe the bug I run yarn in the project root with the following package.json:

{
  "name": "webpage",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "watchify index.js -o static/bundle.js & lite-server"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@celo/contractkit": "^1.1.0",
    "watchify": "^4.0.0",
    "web3": "^1.3.5"
  },
  "devDependencies": {
    "browserify": "^17.0.0",
    "lite-server": "^2.6.1"
  }
}

and get this error:

warn preInstall No repository field
β”Œ [1/3] πŸ”  Resolving dependencies
β”” Completed in 0.352s
β”Œ [2/3] 🚚  Fetching dependencies
β”” 𐄂 Failed
HttpError: Failed to fetch dependencies

error Command failed with exit code 1

Link to the blitz that caused the error https://stackblitz.com/edit/celo-tx-lesson?file=webpage%2Fpackage.json

To Reproduce Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/celo-tx-lesson
  2. cd into the webpage directory
  3. run yarn in the terminal

Expected behavior the packages should install

Version of webcontainer Hash: 57be275669708b1d42e233d60c80159bef577631

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): Browser name = Chrome Full version = 90.0.4430.212 Major version = 90 navigator.appName = Netscape navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 performance.memory = { totalJSHeapSize: 538266974, usedJSHeapSize: 521884186, jsHeapSizeLimit: 4294705152 }

Additional context Add any other context about the problem here.

KwintenP commented 3 years ago

Hi!

It seems like you changed the blitz after reporting this issue. There doesn't seem to be a webpage directory.

I do see that now it fails for another reason.

ERR!: No git binary found in $PATH

We do indeed not yet have git support in the terminal (it's coming soon!). I wonder what tries to use the git binary though as we don't execute postInstall scripts by default. I'll take a look.

In the meantime, can you update the blitz to reflect the initial error? πŸ™ !

critesjosh commented 3 years ago

Maybe I forgot to save it after I added the webpage directory. It should be there now.

EricSimons commented 3 years ago

@critesjosh can you post a screenshot of your chrome console and network tab (esp for any failed requests)? That might help us see what’s going wrong here

critesjosh commented 3 years ago
Screen Shot 2021-05-28 at 9 37 50 AM

Looks like it was a problem with the contractkit package. I removed it and it worked.

d3lm commented 3 years ago

Yep, indeed. Something is failing on the server side when @celo/contractkit is added as a dependencies. In particular, it's @celo/utils which has some dependencies, e.g. country-list which return with Bad Request. This seems to be a bug. Thanks for reporting the issue.

d3lm commented 1 year ago

Hey πŸ‘‹ Git dependencies are not supported in our classic editor and if you rely on them you'd have to use Codeflow for this. That's because npm or yarn usually rely on git from the shell which is only available in Codeflow. For now we won't enable git in the terminal and we suggest to use Codeflow instead, so I am going to close this issue. Feel free to open a new ticket in case you run into other issues.