Ngx-chips: Can't build project, when AOT is enabled

Created on 15 Jan 2018  路  18Comments  路  Source: Gbuomprisco/ngx-chips

PLEASE MAKE SURE THAT:

  • you searched similar issues online (9/10 issues in this repo are solved by googling, so please...do it)
  • you provide an online demo I can see without having to replicate your environment
  • you help me by debugging your issue, and if you can't, do go on filling out this form

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] support request/question

Notice: feature requests will be ignored, submit a PR if you'd like

Current behavior

I'm using ngx-chips in my project. But I can't build it, when i have --aot=true, I have such error during the build:

ERROR in ./src/$$_gendir/node_modules/ngx-chips/ngx-chips.ngfactory.ts
Module not found: Error: Can't resolve 'ngx-chips/components/index' in '/builder/workspace/projectAPP/src/$$_gendir/node_modules/ngx-chips'
resolve 'ngx-chips/components/index' in '/builder/workspace/projectAPP/src/$$_gendir/node_modules/ngx-chips'
  Parsed request is a module
  using description file: /builder/workspace/projectAPP/package.json (relative path: ./src/$$_gendir/node_modules/ngx-chips)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /builder/workspace/projectAPP/package.json (relative path: ./src/$$_gendir/node_modules/ngx-chips)
    resolve as module
      /builder/workspace/projectAPP/src/$$_gendir/node_modules/ngx-chips/node_modules doesn't exist or is not a directory
      /builder/workspace/projectAPP/src/$$_gendir/node_modules/node_modules doesn't exist or is not a directory
      /builder/workspace/projectAPP/src/node_modules doesn't exist or is not a directory
      /builder/workspace/node_modules doesn't exist or is not a directory
      /builder/node_modules doesn't exist or is not a directory
      /home/CS/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /builder/workspace/projectAPP/node_modules
        using description file: /builder/workspace/projectAPP/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /builder/workspace/projectAPP/package.json (relative path: ./node_modules)
          using description file: /builder/workspace/projectAPP/node_modules/ngx-chips/package.json (relative path: ./components/index)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /builder/workspace/projectAPP/node_modules/ngx-chips/components/index doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /builder/workspace/projectAPP/node_modules/ngx-chips/components/index.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /builder/workspace/projectAPP/node_modules/ngx-chips/components/index.js doesn't exist
            as directory
              /builder/workspace/projectAPP/node_modules/ngx-chips/components/index doesn't exist

when i add --aot=false - everything is cool

Expected behavior

I can build project with ngx-chips with AOT enabled.

Minimal reproduction of the problem with instructions (if applicable)

What do you use to build your app?. Please specify the version

Angular version:

"@angular/animations": "4.2.6",
"@angular/common": "4.2.6",
"@angular/compiler": "4.2.6",
"@angular/core": "4.2.6",
"@angular/forms": "4.2.6",
"@angular/http": "4.2.6",
"@angular/platform-browser": "4.2.6",
"@angular/platform-browser-dynamic": "4.2.6",
"@angular/router": "4.2.6",
"@angular/cli": "1.4.9",
"@angular/compiler-cli": "4.2.6",

ngx-chips version:

"ngx-chips": "^1.6.3"

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

all

Most helpful comment

I have the same error.

[...\src\ngx-chips\components\index]
 @ ./src/$$_gendir/node_modules/ngx-chips/ngx-chips.ngfactory.ts 7:0-716
 @ ./src/$$_gendir/app/pages/dashboard/runit/runit.component.ngfactory.ts
 @ ./src/$$_gendir/app/pages/dashboard/dashboard.component.ngfactory.ts
 @ ./src/$$_gendir/app/pages/pages.module.ngfactory.ts
 @ ./src/$$_gendir lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi ./src/main.ts
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `rimraf dist && ng build "--prod"`
npm ERR! Exit status 1
npm ERR!

All 18 comments

I have the same error.

[...\src\ngx-chips\components\index]
 @ ./src/$$_gendir/node_modules/ngx-chips/ngx-chips.ngfactory.ts 7:0-716
 @ ./src/$$_gendir/app/pages/dashboard/runit/runit.component.ngfactory.ts
 @ ./src/$$_gendir/app/pages/dashboard/dashboard.component.ngfactory.ts
 @ ./src/$$_gendir/app/pages/pages.module.ngfactory.ts
 @ ./src/$$_gendir lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi ./src/main.ts
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `rimraf dist && ng build "--prod"`
npm ERR! Exit status 1
npm ERR!

I've got the same error trying to build in production my ionic app that uses ngx-chips.

Probably the problem is caused by the use of the ngx-chips INSIDE a component.

Are you using angular v4 or v5? I'd suggest try updating to v5 and retry? Otherwise try downgrading ngx-chips version.

I found out that the problem is in the latest build published on npm. Forcing an older version (1.5.3) it works correctly.

I got the same error while trying to build below in prod uses ngx-chips 1.5.2 or 1.6.3 (use @ angular/cli version below)
ng build 鈥揵ase-href / --watch --output-path=dist --target=production --environment=prod

"@ angular/cli"
1.2.7/1.2.8/1.4.9/1.5.1/1.5.5/1.6.4

Angular version:
"@ angular/animations": "4.4.6",
"@ angular/common": "4.4.6",
"@ angular/compiler": "4.4.6",
"@ angular/core": "4.4.6",
"@ angular/forms": "4.4.6",
"@ angular/http": "4.4.6",
"@ angular/platform-browser": "4.4.6",
"@ angular/platform-browser-dynamic": "4.4.6",
"@ angular/router": "4.4.6",
"@ angular/compiler-cli": "4.4.6",

I have the same error.
ERROR in ./src/$$_gendir/~/ngx-chips/ngx-chips.ngfactory.ts
Module not found: Error: Can't resolve 'ngx-chips/components/index' in 'project\src\$$_gendir\node_modulesngx-chips'
@ ./src/$$_gendir/~/ngx-chips/ngx-chips.ngfactory.ts 7:0-716
@ ./src/$$_gendir/app/test/test.component.ngfactory.ts
@ ./src/$$_gendir/app/test/test.module.ngfactory.ts
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts

Is there any follow up in this matter?

same problem without --aot but with --prod options. (angular 4.4.3 - ngx-chips 1.6.3) .

still appears

It hasn't been fixed yet, use the previous version

Can anyone try the latest version?

"@angular/*": "5.2.5"
"ngx-chips": "1.6.3-rc.3"

ERROR in node_modulesngx-chipsngx-chips.d.ts.TagInputComponent.html(7,6): : Argument of type 'undefined' is not assignable to parameter of type 'number'.

And is it just me or has the version number going in reverse. You released 1.6.3 and now your releasing the RCs? Shouldn't it be called 1.6.4-rc.3?

Yes, it wasn't intentional

Not working with 1.6.4-rc.3 @Gbuomprisco Please help.

will attempt to fix in the weekend

Thanks for Sprechen, older version (1.5.3) works correctly

Hi, this should be solved with 1.6.5

What is the fix ? I am on 1.6.3 and all angular CLI 4.3.2. Get this error.

ERROR in ./build/aot/node_modules/ngx-chips/ngx-chips.ngfactory.ts
Module not found: Error: Can't resolve 'ngx-chips/components/index'

Upgrading to Angular 5 is not an option as of now for me. How did you fix this ?

I tried various combinations of ngx chips (1.6.0,1.6.0,1.6.2,1.6.3) and angular 4. but none work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukas-bernert picture lukas-bernert  路  4Comments

cyrilrbt picture cyrilrbt  路  4Comments

altschuler picture altschuler  路  3Comments

DevInstinct picture DevInstinct  路  4Comments

RaghulXander picture RaghulXander  路  3Comments