minio-js: Doesn't work with Angular 6

Because crypto, fs, path, and stream are no longer exposed via webpack polyfills, attempting to use this dependency results in multiple ERROR in ./node_modules/minio/dist/main/minio.js Module not found: Error: Can't resolve 'crypto' in '[omitted]/node_modules/minio/dist/main' errors.

Pulling an answer from https://github.com/angular/angular-cli/issues/1548#issuecomment-386871992 “crypto-browserify can be used in combination with a tsconfig path mapping to map crypto to the package.”

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 17 (3 by maintainers)

Most upvoted comments

@ng-plex @pgsekaran
Please try

import * as Minio from 'minio'
const S3 = new Minio.Client(...)