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

Angular 6 support (build error) #36

Closed
danail-vasilev opened this issue Dec 2, 2018 · 1 comment
Closed

Angular 6 support (build error) #36

danail-vasilev opened this issue Dec 2, 2018 · 1 comment

Comments

@danail-vasilev
Copy link

danail-vasilev commented Dec 2, 2018

Hello,
Is the lib supported in Angular 6 because I am observing issues?

Steps to reproduce the issue

  1. Create app -> ng new my-app (use cli 6.2.6)
  2. App setup:
    package.json:
    ...
    "@angular/common": "6.1.10",
    ...
    "@angular/cli": "6.2.6",
    "browserify-zlib": "0.2.0"
    ...
    mycomponent.ts:
    // var zlib = require("browserify-zlib");
    import * as zlib from "browserify-zlib";

zlib.deflate(text, cb);

Actual behavior (issues):

  1. Module not found: Error: Can't resolve 'stream' in \node_modules\browserify-zlib\lib
  2. After installing the stream package -> Uncaught ReferenceError: global is not defined
  3. After setting (window as any).global = window; in polyfills.ts -> Cannot read property 'prototype' of undefined
  4. Tried setting "allowSyntheticDefaultImports": true in tsconfig.json -> same error as above
  5. Tried setting "paths": { "browserify-zlib": [ "node_modules/browserify-zlib/lib/index.js", "node_modules/browserify-zlib/lib/binding.js"] }, in tsconfig.json -> same error as above
    p.s. I use pako for the deflation without any issues, however, the above is still valid for this lib.
@devongovett
Copy link
Member

I don't think this is an issue with this package, but with the build tool you're using not properly providing the stream module.

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