Skip to content

Third party library fails after upgrade cli #10305

@julianobrasil

Description

@julianobrasil

Versions

Angular CLI: 6.0.0-rc.3
Node: 8.11.1
OS: win32 x64
Angular: 6.0.0-rc.4
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router

@angular/cdk: 6.0.0-rc.2
@angular/cli: 6.0.0-rc.3
@angular/flex-layout: 5.0.0-beta.14
@angular/material-moment-adapter: 6.0.0-rc.2
@angular/material: 6.0.0-rc.2
@angular-devkit/architect: 0.5.5
@angular-devkit/build-angular: 0.5.5
@angular-devkit/build-optimizer: 0.5.5
@angular-devkit/core: 0.5.5
@angular-devkit/schematics: 0.5.5
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 6.0.0-rc.3
@schematics/angular: 0.5.5
@schematics/update: 0.5.5
typescript: 2.7.2
webpack: 4.5.0

Repro steps

  • Install ng2-dragula
  • run ng serve: no errors
  • Try to open the app and take a look at the console to see the error message (complaining about Uncaught ReferenceError: global is not defined) while the app doesn't run

Observed behavior

index.js:2 Uncaught ReferenceError: global is not defined
    at Object../node_modules/crossvent/node_modules/custom-event/index.js (index.js:2)
    at __webpack_require__ (bootstrap:74)
    at Object../node_modules/crossvent/src/crossvent.js (crossvent.js:3)
    at __webpack_require__ (bootstrap:74)
    at Object../node_modules/dragula/dragula.js (dragula.js:4)
    at __webpack_require__ (bootstrap:74)
    at Object../node_modules/ng2-dragula/components/dragula.class.js (dragula.class.js:2)
    at __webpack_require__ (bootstrap:74)
    at Object../node_modules/ng2-dragula/index.js (index.js:2)
    at __webpack_require__ (bootstrap:74)

Desired behavior

@angular/cli shouldn't insert any errors (look in the next item - below -that @angular 6.0.0-rc.0 and @angular 6.0.0-rc.4 work right with @angular/cli 1.7.4). At some point ( @angular 6.0.0-rc.1) angular itself was preventing dragula from work. But this behavior introduced in rc.1 was changed in rc.4. Now only @angular/cli 6.0.0-rc.x is preventing dragula from work in a full upgraded project.

Mention any other details that might be useful (optional)

@angular/cli 1.7.4 + @angular 6.0.0-rc.0 => works
@angular/cli 1.7.4 + @angular 6.0.0-rc.1 => fails
@angular/cli 1.7.4 + @angular 6.0.0-rc.2 => fails
@angular/cli 1.7.4 + @angular 6.0.0-rc.3 => fails
@angular/cli 1.7.4 + @angular 6.0.0-rc.4 => works

  • @angular/cli 6.0.0-rc.x + @angular 6.0.0-rc.x => fails with all of 6.0.0-rc angular versions

There's a repo available here: https://github.com/julianobrasil/material2-test/tree/dragula

Just take away DragulaModule from app.module.ts and the app runs without errors.

There's already an issue opened at dragula's repo on this subject: valor-software/ng2-dragula#849

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