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
Buffer not set correcly #1753
Comments
I think that the problem is with your setup and with Vite not with the library. But I'm not sure how to setup Vite properly so it works like in the browser. Since you run the NodeJS version of isomorphic-git from the browser. I'm not Vite expert, but you can try to figure out for yourself why Vite reads the NodeJS version and how to setup it up properly. But this is just my guess why Vite fails. |
If I remember correctly, Vite uses esbuild and this is an esbuild issue… right found it: vitejs/vite#2785 |
@aral thanks for the reference. |
Hey, I'm using SvelteKit/Vite too :) But yeah, import { Buffer } from "buffer";
globalThis.Buffer = Buffer; seems to be a working solution. |
There was an issue #698 but now when @wmhilton left the project there is no one that would remove Buffer from code. |
Setup
Browser, bundled with Vite (SvelteKit)
Reproduce
Create try a (browser based) git clone as per docs using ESM import syntax.
Behaviour
The following error occurs:
Hot-Fix
This problem is fixed when adding the following lines:
Real-Fix
Investigate why Buffer is not defined/not imported properly when using the described setup.
The text was updated successfully, but these errors were encountered: