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

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

Closed
yaahor opened this issue May 25, 2017 · 4 comments
Closed

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

yaahor opened this issue May 25, 2017 · 4 comments
Assignees
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@yaahor
Copy link

yaahor commented May 25, 2017

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.

@sumitarora sumitarora added the needs: investigation Requires some digging to determine if action is needed label May 30, 2017
@filipesilva filipesilva self-assigned this Jun 1, 2017
@filipesilva
Copy link
Contributor

@yaahor can you try with @angular/[email protected]? #6276 changed slightly, and I think yours might be one of the affected cases.

Also, when you run ng in a project folder it should use the local version. To check the global version, run ng -v outside a project folder.

@codegastudio
Copy link

codegastudio commented Jun 19, 2017

Hello
have the same issue and using autobahn 17.5.1.
Have you try each version between 17.5.1 and 0.11.2 ?
update to 1.1.0 not solve my problem

Impossible to use flag --prod

Time: 35025ms
chunk    {0} polyfills.e9bbb65874590553bbf4.bundle.js (polyfills) 157 kB {4} [initial] [rendered]
chunk    {1} main.c86b19f5118b313bc28d.bundle.js (main) 625 kB {3} [initial] [rendered]
chunk    {2} styles.5d397e548b6185c076f0.bundle.css (styles) 175 bytes {4} [initial] [rendered]
chunk    {3} vendor.31635616814b238ac373.bundle.js (vendor) 6.04 MB [initial] [rendered]
chunk    {4} inline.b27dcce2ce883042554e.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in vendor.31635616814b238ac373.bundle.js from UglifyJs
Unexpected token: name (Simple) [vendor.31635616814b238ac373.bundle.js:16154,6]

@catull
Copy link
Contributor

catull commented Aug 6, 2017

@yaahor @codegastudio Is this still an issue ?

Was able to follow your instructions with ng CLI 1.2.7, like so:

   ng new motorway
   cd motorway
   npm install autobahn --save
   npm install @types/autobahn --save

Both ng build -prod (A) and node_modules/.bin/ng build -prod (B) produce an app without errors.
Both builds serve up a simple app with ng serve on http://localhost:4200.
I removed the dist/ folder before building either app version (A & B).

Please confirm the issue is resolved by now.

@yaahor yaahor closed this as completed Aug 6, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

5 participants