Skip to content

Different behavior on local and global angular-cli of the same version #6453

Closed
@yaahor

Description

@yaahor

Bug Report or Feature Request (mark with an x)

- [x] bug report
- [ ] feature request

Versions.

Local angular-cli version (node_modules\.bin\ng -v):

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.4
node: 6.9.2
os: win32 x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.4
@angular/compiler-cli: 4.1.3

Global angular-cli version (ng -v):

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.4
node: 6.9.2
os: win32 x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.4
@angular/compiler-cli: 4.1.3

Repro steps.

npm install autobahn --save
npm install @types/autobahn --save

Use "autobahn" in project.

If run ng build -prod, you can see that your project is built successfully.
If run node_modules\.bin\ng build -prod, error will be thrown.

ERROR in vendor.c00f0a15a11c060eba86.bundle.js from UglifyJs
Unexpected token: name (Simple) [vendor.c00f0a15a11c060eba86.bundle.js:8889,6]

The log given by the failure.

Result of running node_modules\.bin\ng build -prod -sm:

ERROR in vendor.c00f0a15a11c060eba86.bundle.js from UglifyJs
Unexpected token: name (Simple) [./~/cbor/lib/simple.js:9,0][vendor.c00f0a15a11c060eba86.bundle.js:8889,6]

Desired functionality.

The same behavior of global and local angilar-cli of the same version

Mention any other details that might be useful.

"cbor" package is dependency of "autobahn".

Property "target" is set to "es5" in tsconfig.json.

tsconfig.app.json:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "module": "es2015",
    "baseUrl": "",
    "types": []
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ]
}

tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2016",
      "dom"
    ]
  }
}

I have solved issue by using previous version of autobahn (0.11.2), but I can not understand why building by global ang local angular-cli of the same version behave differently.

Metadata

Metadata

Assignees

Labels

needs: investigationRequires some digging to determine if action is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions