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

Fix issues with browser environment #955

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

prakashsvmx
Copy link
Member

@prakashsvmx prakashsvmx commented Aug 10, 2021

Fix issues with browser environment

Fixes #954

How to test:

Replicating the issue:

Clone and run : https://github.com/prakashsvmx/minio-js-web-browser-example
npm install
npm start

Create bucket, upload objects and remove All
Note the error

Testing the fix:
Checkout this branch and run the below commands
npm install
npm run lint
npm run browserify
npm run test - Optional since it runs unit test and functional tests

run npm link on the root folder this is important

Clone : https://github.com/prakashsvmx/minio-js-web-browser-example
npm install
npm link minio - this is important to get this fix into this repo for local testing
npm start

Copy link
Collaborator

@kanagarajkm kanagarajkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested. one minor comment

@@ -16,6 +16,7 @@

import stream from 'stream'
import mime from 'mime-types'
var Crypto = require('crypto')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do import Crypto from 'crypto'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This imports based on browserify environment. So this is needed. For md5 to to be browserified and work in browser environment.

@harshavardhana harshavardhana merged commit 81aea06 into minio:master Aug 13, 2021
@prakashsvmx prakashsvmx deleted the fix-for-web-browser branch February 10, 2022 16:53
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

Successfully merging this pull request may close these issues.

removeObjects: "undefined is not a constructor (evaluating 'new _util.default.TextEncoder()')"
3 participants