ionic-app-scripts build fails due to AOT
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:
- 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
Hello, thanks for opening an issue! Are you importing ClickBlock or TranslatePipe anywhere in your project?
@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.
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..
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.
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 😃
See pull #8914 commit https://github.com/driftyco/ionic/pull/8914/commits/9beec8da6e268fcab70e0faad4ccd961cfa98ac5
Thanks
@jgw96 awesome, a new release :) I'll give it a try right a way 👍
@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.
@Manduro true, reverting seems to allow the build to succeed.
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 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.
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.
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?
+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)
Same problem:
Cannot determine the module for class ClickBlock
@angular 2.2.3
Any help
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.
still not working
Same issue with version 2.2.1.
I have the same issue with 2.3.1 # @jgw96
Same on 2.4.1