question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build project, when AOT is enabled

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jsoladurcommented, Jan 16, 2018

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! everseed@0.1.0 build: `rimraf dist && ng build "--prod"`
npm ERR! Exit status 1
npm ERR!
1reaction
Gbuompriscocommented, Feb 24, 2018

Hi, this should be solved with 1.6.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apps cannot build with AOT if a dependent library was built ...
This issue describes mysterious build failures for apps that depend on an npm-installed library that was built with barrels.
Read more >
ng build fails if AOT is enabled (Angular 11) - DayPilot Forums
I'd try reinstalling @angular/cli, there might be a temporary bad dependency somewhere. That is not unusual - just a couple of minutes ago,...
Read more >
Does 'ng build' use AOT compilation when production is set to ...
The AOT is not used by default using the build command. Only when you add the --prod parameter. This will set the --target...
Read more >
Ahead-of-time (AOT) compilation - Angular
This guide explains how to specify metadata and apply available compiler options to compile your applications efficiently using the AOT compiler.
Read more >
Xamarin.iOS errors - Microsoft Learn
This condition can occur if incremental builds are not either enabled or disabled in all the projects. because the I18N assemblies are different ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found