angular-tree-component icon indicating copy to clipboard operation
angular-tree-component copied to clipboard

Uglify Error - Unexpected token punc «,», expected punc «:»

Open jgolebiewski opened this issue 9 years ago • 14 comments

I'm using angular-seed with systemjs-builder and during build.prod process it stops on uglifying file angular-tree-component.umd.js.

If you paste code from this file here https://skalman.github.io/UglifyJS-online/

you can get the same result.

@version angular-tree-component 3.2.4

Parse error: Unexpected token punc «,», expected punc «:» Line 20349, column 14 20348: var array = { 20349: chunk, compact, concat, difference, differenceBy, 20350: differenceWith, drop, dropRight, dropRightWhile, dropWhile,

jgolebiewski avatar Apr 11 '17 21:04 jgolebiewski

I'm getting a similar error during (karma) unit tests (see below).

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  SyntaxError: Unexpected token ','
  at webpack:///~/angular-tree-component/dist/angular-tree-component.umd.js:20348:0 <- src/tests.entry.ts:153619
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  SyntaxError: Unexpected token ','
  at webpack:///~/angular-tree-component/dist/angular-tree-component.umd.js:20348:0 <- src/tests.entry.ts:153619

PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (1.097 secs / 0 secs)

sjdemoor avatar Apr 12 '17 20:04 sjdemoor

+1, I resolved this issue by compiling angular-tree-component/dist/angular-tree-component.umd.js to es5, here is the steps:

  1. Go to angular-tree-component folder and rename angular-tree-component.umd.js to angular-tree-component.umd.ts.
  2. Run tsc angular-tree-component.umd.ts --module es2105 --target es5,
  3. In jspm.config.js,
map: {
...
"angular-tree-component": "npm:[email protected]/dist/angular-tree-component.umd.js",
...
}

BTW, to resolve this issue permanently, I think the 500tech team needs to generate an es5 file.

chendachao avatar Apr 15 '17 02:04 chendachao

Hi @jgolebiewski , @sjdemoor , @chendachao ,

Can you try with the new version 3.3.0? BTW - in 3.3.0 the UMD bundle is already uglified.

Although I find this strange, it should be an ES5 file to begin with.

adamkleingit avatar Apr 17 '17 17:04 adamkleingit

Hi, Now building process is Ok but durnig launch I'm getting this error

Module not already loaded loading "lodash/defaultsDeep" node_modules/angular-tree-component/dist/angular-tree-component.umd.js:2:27961

jgolebiewski avatar Apr 17 '17 18:04 jgolebiewski

@jgolebiewski - error or warning?

adamkleingit avatar Apr 18 '17 14:04 adamkleingit

Error

jgolebiewski avatar Apr 18 '17 16:04 jgolebiewski

I now get the same error. Just ran npm update/install and now I can't start that application.

myieye avatar Apr 19 '17 11:04 myieye

@myieye @jgolebiewski Yes I was able to reproduce using SystemJS. Will try to solve

adamkleingit avatar Apr 19 '17 13:04 adamkleingit

I get the same error since the update 3.3.1

Error: Module not already loaded loading "lodash/defaultsDeep" node_modules/angular-tree-component/dist/angular-tree-component.umd.js:2:27961

I can't start my application anymore. Hope someone can provide a solution...

Nicolas1701 avatar Apr 20 '17 09:04 Nicolas1701

Also experiencing the same issue

Error: Module not already loaded loading "lodash/defaultsDeep"

jb201 avatar Apr 22 '17 01:04 jb201

Using SystemJS and angular-seed, having the same issue, been stuck on it for two days. Really hope someone provides any kind of solution.

ahmedsivac911 avatar Apr 24 '17 07:04 ahmedsivac911

See my comment in issue #262 for a workaround of the lodash/* issues.

gpapp avatar Apr 24 '17 07:04 gpapp

We're using angular-seed, and there is no system.config.js file, but i tried adding variations of your lines from the comment in project-config, no luck...

ahmedsivac911 avatar Apr 24 '17 11:04 ahmedsivac911

Should be fixed in 3.4.1

adamkleingit avatar Apr 29 '17 14:04 adamkleingit