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

compatibility issue of standalone bundle in jsfiddle #151

Closed
smcatala opened this issue Jan 24, 2017 · 1 comment
Closed

compatibility issue of standalone bundle in jsfiddle #151

smcatala opened this issue Jan 24, 2017 · 1 comment

Comments

@smcatala
Copy link

strangely enough, the example from the Node documentation for Buffer.from(string, [encoding])
does not seem to work in jsfiddle when using the standalone bundle:
https://jsfiddle.net/2szjx8zp/ (tested in Chrome and Firefox)

the example can be made to work by replacing Buffer.from() calls with new Buffer(), the latter being the deprecated predecessor of the former.

for some reason, the static 'from' method of the Buffer class seems to be that of the underlying TypedArray, which is not equivalent to that of Node's Buffer.

@feross
Copy link
Owner

feross commented Jan 24, 2017

It looks like the version of buffer served by https://wzrd.in/standalone/buffer is v4.x, not v5.x. I suspect this is because browserify is still bundling v4.x of this package. I'll get that updated soon.

If you test with the latest version of the code in this repo, you'll see that your code sample works just fine.

Update: PR opened here: browserify/browserify#1678

@feross feross closed this as completed Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants