ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

ionic-app-scripts build fails due to AOT

Open rolandjitsu opened this issue 10 years ago • 25 comments

Short description of the problem:

Running ionic-app-scripts build fails with:

[21:56:53]  Error: Cannot determine the module for class ClickBlock in 
            /Users/rolandjitsu/Projects/infarm/operator/node_modules/ionic-angular/util/click-block.d.ts! 
[21:56:53]  Cannot determine the module for class TranslatePipe in 
            /Users/rolandjitsu/Projects/infarm/operator/node_modules/ionic-angular/translation/translate_pipe.d.ts! 
[21:56:53]  ngc failed 
[21:56:53]  ionic-app-script task: "build" 
[21:56:53]  Error: Error

What behavior are you expecting?

It should build without errors.

Steps to reproduce:

  1. Run ionic-app-scripts build

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc) Note that I am using "@angular/compiler-cli": "^2.1.2".

Which Ionic Version? 1.x or 2.x Ionic 2 RC.1

Your system information:

Cordova CLI: Not installed Ionic Framework Version: 2.0.0-rc.1 Ionic CLI Version: 2.1.0 Ionic App Lib Version: 2.1.0-beta.1 ios-deploy version: Not installed ios-sim version: Not installed OS: Mac OS X El Capitan Node Version: v6.7.0 Xcode version: Xcode 8.1 Build version 8B62

rolandjitsu avatar Nov 03 '16 20:11 rolandjitsu

Hello, thanks for opening an issue! Are you importing ClickBlock or TranslatePipe anywhere in your project?

jgw96 avatar Nov 03 '16 20:11 jgw96

@jgw96 not explicitly, no. At this point I am moving codebase from an earlier version of Ionic 2 to the latest and I only have 2 components with almost no logic. So I have very minimal imports.

rolandjitsu avatar Nov 03 '16 20:11 rolandjitsu

From a Gitter conversation in angular with Alex Rickabaugh It's saying that you're referencing ClickBlock and TranslatePipe somewhere, but not importing them via a module., looking at the source of ionic-angular, I don't see ClickBlock declared in a module..

rolandjitsu avatar Nov 03 '16 20:11 rolandjitsu

I've seen this too, this is occurring when using [email protected]. Revert to 2.1.1 and you can build again. The ClickBlock and TranslatePipe should probably be added in Ionic's src/directives.ts to fix this.

Manduro avatar Nov 03 '16 21:11 Manduro

Hmm @rolandjitsu @Manduro can you try changing your package.json to match the latest and trying again? Thanks.

ps. there is a surprise in that package.json 😃

jgw96 avatar Nov 03 '16 22:11 jgw96

See pull #8914 commit https://github.com/driftyco/ionic/pull/8914/commits/9beec8da6e268fcab70e0faad4ccd961cfa98ac5

Thanks

ramonornela avatar Nov 04 '16 06:11 ramonornela

@jgw96 awesome, a new release :) I'll give it a try right a way 👍

rolandjitsu avatar Nov 04 '16 13:11 rolandjitsu

@jgw96 is there a reason why you don't use 2.1.2 and you use 2.1.1? As far as I can see there are no breaking changes.

rolandjitsu avatar Nov 04 '16 13:11 rolandjitsu

@Manduro true, reverting seems to allow the build to succeed.

rolandjitsu avatar Nov 04 '16 13:11 rolandjitsu

Good question, so we are running 2.1.1 in this release for the simple fact that we have not yet put 2.1.2 through testing yet. While everything should "just work" because of semver rules, we have been bitten enough times to be weary of this. While we always strive, and will continue too, be on the latest angular, with how semver works there may be times where we are a few minor versions off. We definitely wont ever be very far behind though, especially if there are big bug fixes in the next version of Angular etc.

jgw96 avatar Nov 04 '16 16:11 jgw96

@jgw96 it makes perfect sense. And it does actually cause issues, using 2.1.2, since during build I get the error I reported, and going back to 2.1.1 works just fine.

rolandjitsu avatar Nov 04 '16 17:11 rolandjitsu

Hello @rolandjitsu thanks for the reply! That is expected behavior. With the next release we will again bump our version of Angular to the latest.

jgw96 avatar Nov 07 '16 10:11 jgw96

Hey guys, Are there any updates on this issue? I am also having problems on Travis with the following: "Cannot determine the module for class ClickBlock in ....../node_modules/ionic-angular/util/click-block.d.ts!"

Works fine on the local machine, but fails on travis. Any ideas ro updates?

TheYuwana avatar Nov 25 '16 09:11 TheYuwana

+1 on Windows 10 x64 Node 6.2.0

Error: Cannot determine the module for class ClickBlock in 
node_modules/ionic-angular/util/click-block.d.ts!

I attempted to update the @angular packages from 2.1.1 to 2.2.1 (as is the version now being used in the main ionic package)

stewhouston avatar Nov 29 '16 18:11 stewhouston

Same problem:

Cannot determine the module for class ClickBlock

@angular 2.2.3

Any help

compitDanielos avatar Nov 30 '16 07:11 compitDanielos

Same issue here, we had to go back to 2.1.1 temporarily. Neither 2.2.4 nor 2.3.0-rc.0 seems to address this issue.

elsesiy avatar Dec 02 '16 16:12 elsesiy

still not working

thardes2 avatar Dec 08 '16 11:12 thardes2

Same issue with version 2.2.1.

zeornelas avatar Dec 12 '16 10:12 zeornelas

I have the same issue with 2.3.1 # @jgw96

davidgodzsak avatar Dec 15 '16 11:12 davidgodzsak

Same on 2.4.1

noroot avatar Jan 18 '17 14:01 noroot