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

How to point dependency to a github branch #1466

Closed
sartaj10 opened this issue Jan 14, 2019 · 7 comments
Closed

How to point dependency to a github branch #1466

sartaj10 opened this issue Jan 14, 2019 · 7 comments
Labels
🎒 Bundler Refers to CodeSandbox's In-Browser Bundler Packager

Comments

@sartaj10
Copy link

❔ Question

Hi,
I would like to point my dependency to a branch on github, rather than a particular version. In my package.json, I've pointed it like this :

"react-timeseries-charts": "esnet/react-timeseries-charts#fix-355"

However, this doesn't work and I get this message

Could not fetch dependencies, please try again in a couple seconds: Unexpected token < in JSON at position 0

I saw an issue (#88) that suggests that this should work. Could you point me as to how to go about this?

Link to sandbox: link

Your Environment

Software Name/Version
Сodesandbox
Browser Chrome
Operating System macOS Sierra
@tomasfrancisco
Copy link

tomasfrancisco commented Jan 24, 2019

I'm facing the same issue. I cannot figure out how to add a GitHub dependency.
Is it really supported?

I've tried the following:
lightbasenl/lightbot.js
lightbasenl/lightbot.js#master
https://github.com/lightbasenl/lightbot.js
https://github.com/lightbasenl/lightbot.js#master

None of them worked, unfortunately :(

Here's the example I'm working on: https://codesandbox.io/s/z6j7954jnx

@CompuIves
Copy link
Member

CompuIves commented Jan 24, 2019

It's possible to install GitHub dependencies. Keep in mind that we just serve the source files of the GitHub repo (like npm and yarn), we do run the postinstall script, so if you want to build some files you can put it in that step.

Regarding esnet/react-timeseries-charts#fix-355, I just found out that our caching system doesn't support # in the paths, that's why it's showing those errors. I can take a look at that.

Here's the example I'm working on: codesandbox.io/s/z6j7954jnx

I get a different error in that sandbox, about missing regeneratorRuntime. I think that's because babel-polyfill is not required in the project. Going to double check that.

Never mind, that's an issue on our side. Going to take a look!

Committed a fix on master for the regeneratorRuntime error.

@lbogdan lbogdan added bug? Packager 🎒 Bundler Refers to CodeSandbox's In-Browser Bundler labels Mar 22, 2019
@dai-shi
Copy link

dai-shi commented May 20, 2019

A workaround is to use tar.gz URL:

"react-timeseries-charts": "https://github.com/esnet/react-timeseries-charts/archive/fix-355.tar.gz"

@dabernathy89
Copy link

Using the tar.gz URL doesn't seem to work anymore. Anyone figured out a working solution for pulling in a dependency from a Github branch?

@garethx garethx removed the bug? label May 14, 2020
@github-actions
Copy link

github-actions bot commented Sep 4, 2020

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

@github-actions github-actions bot added the stale label Sep 4, 2020
@github-actions
Copy link

This issue has been automatically closed because there wasn't any activity after the previous notice or the stale label wasn't removed.

@perymimon
Copy link

perymimon commented Jul 7, 2022

It looks like Codesandbox using https://www.jsdelivr.com/ to supply the dependency.
and jsdeliver using git tag to find the repository.
so I end up with that steps for a solution :

  1. push a new tag to my GitHub repository (tag v3.0.0)
  2. then check it to work https://cdn.jsdelivr.net/gh/perymimon/react-anime-manager@v3.0.0/package.json in the browser.
  3. going to codesandbox/package.json
  4. under "dependencies" add :
    "@perymimon/react-anime-manager": "perymimon/react-anime-manager#v3.0.0"

BUT it looks like I still can't import it to my file. in check on a sperate window and look on source/file-tree and not found the folder perymimon/react-anime-manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎒 Bundler Refers to CodeSandbox's In-Browser Bundler Packager
Projects
None yet
Development

No branches or pull requests

8 participants