Skip to content

Angular 6 support (build error) #36

Closed

Description

@danail-vasilev

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.

Activity

  1. devongovett commented on Sep 8, 2019

    @devongovett
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions