stackblitz / webcontainer-core

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

Git URL dependency support #831

Open cherniavskii opened 2 years ago

cherniavskii commented 2 years ago

Describe the bug

In MUI X repository we have a Git URL dependency: https://github.com/mui/mui-x/blob/next/package.json#L85

This makes dependency installation process fail:

❯ yarn install --verbose
verbose preInstall Validate "package.json"
warn preInstall No description field
warn preInstall No repository field
warn preInstall No license field
┌ [1/4] 🔍  Resolving dependencies
└ Completed in 26.882s
verbose Skipping audit
┌ [2/4] 🚚  Fetching dependencies
│ info pruneDeps Excluding 1 dependency. For more information use `--verbose`.
│ └─ node_modules/fsevents@2.3.2
└ 𐄂 Failed
HttpError: Failed to fetch dependencies:
- @mui/monorepo@5.10.9

error Command failed with exit code 1

Link to the blitz that caused the error

https://stackblitz.com/~/github.com/mui/mui-x

Steps to reproduce

  1. Go to https://stackblitz.com/~/github.com/mui/mui-x
  2. Install dependencies: yarn install --verbose

Expected behavior

Git URL dependencies are supported

Parity with Local

Screenshots

No response

Platform

Version = 1.67.0
Hash = 35b869fee6c097380f8b2e33563ab4a16c08f57b
WebContainer = ea2f6b48b77806aba8e6fe3b6311530cc7674f64

Browser name  = Chrome
Full version  = 105.0.0.0
Major version = 105
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 139561726,
  "usedJSHeapSize": 113588398,
  "jsHeapSizeLimit": 4294705152
}

Additional context

No response

FossPrime commented 2 years ago

They implemented tarball dependency support a couple months ago https://stackblitz.com/edit/vitejs-vite-zfaynu?file=package.json

git support wasn't possible until their git-js CORS proxy was implemented in codeflow

d3lm commented 1 year ago

Hey 👋 Thanks for the report. turbo (our in-house package manager) currently doesn't support git dependencies. You could try to use yarn or pnpm instead which both support this type of dependency. However, for npm we are currently working on native support which will likely resolve this issue.

cherniavskii commented 1 year ago

Hi @d3lm We are actually using yarn. Please try this:

It just stays like this and nothing happens.