question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The README is super confusing. How do I use this in the browser?

See original GitHub issue

This library looks great, but the only clues the README provides for using this library in the browser are broken or confusing.

The Installation section only explains how to use Node.

The example code for the browser (the code that loads a bunch of stuff from unpkg.com) does not work (if I copy, paste and run the code, the then method just logs undefined).

The README claims you can do stuff like import git from 'isomorphic-git', but there’s no export named git (or a default) in the module I have. I probably have the wrong module, but the README provides no clue where to get one from, so I tried the CDN from the broken example code.

I’d ideally like to use this library (and Lightning FS) as ES6 modules, and need to load them from a local server (in development), but do not even know which files I need (I’ve been doing Web development for over ten years, and normally have no trouble with stuff like this).

Any advice would be appreciated. Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crutchcorncommented, Feb 20, 2021

@carlyounger if you want to avoid using NPM, you can also utilize something like an NPM CDN to download the file in-browser:

https://cdn.jsdelivr.net/npm/isomorphic-git@1.8.1/index.umd.min.js

1reaction
crutchcorncommented, Feb 20, 2021

@carlyounger you don’t have to bundle yourself is what I’m saying. If you run npm i isomorphic-git and then look in your node_modules, you will find a pre-prepared .umd.min.js file. If you’re using webpack (or any other bundler), you can simply import from there:

​import​ ​git​,​ ​{​ProgressCallback​}​ ​from​ ​'isomorphic-git/index.umd.min.js'​;

It’s just a slight modification of the typical import

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generated README containing npm examples is confusing ...
Upon app creation the output to the console is the following: Success! Created react-hooks-examples at [...] Inside that directory, you can run ...
Read more >
Your README is a Dumpster Fire - It's Time to Fix That
As a matter of fact, you may actually be confusing them or scaring them away. Write a solid README and the users will...
Read more >
The Chromium super (inline cache) type confusion
In this post I'll exploit CVE-2022-1134, a type confusion in Chrome that I reported in March 2022, which allows remote code execution (RCE)...
Read more >
bootstrap-dark | README.md - vinorodrigues - GitHub Pages
Bootstrap, in its current version (4.5.0), can achieve dark mode support; by exploring if it can be modified to support native OS (or...
Read more >
How to auto-preview a readme.md in a browser?
It was a Bash command-line linking my .md file to my browser, refreshing the page each time I saved changes in the .md...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found