Ionic-framework: ionic-app-scripts build fails due to AOT

Created on 3 Nov 2016  路  25Comments  路  Source: ionic-team/ionic-framework

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

reply

Most helpful comment

Same problem:

Cannot determine the module for class ClickBlock

@angular 2.2.3

Any help

All 25 comments

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 馃槂

@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

Maybe you forgot to add your class to your app.module.ts or app.component.ts, i had the same issue

Same issue with version 2.4.8.

@jgw96 I have a couple of mocks in src/mocks/ionic/slides.mock.ts and it's causing the issue above. What do?

Hi Guys, I was suffering same issue like

Cannot determine the module for class OverlayPortal

Cannot determine the module for class ClickBlock

, etc. This does not happen in my dev build but in my stage and production build ONLY which I believe it is resulted by "--aot" in building path.

I figured out it is because some plugins, which are using those modules, are not compatible to newer ionic/angular/typescript. After using suggestions from @jgw96, I solve it by correcting each default versions as ionic team suggested, here is new link from ionic starter project.

From here on, when you are trying to upgrade dependencies or upgrade ionic platform, I would strongly recommended with starter project setting which should be most latest and compatible.

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tianleios picture tianleios  路  84Comments

marcovtwout picture marcovtwout  路  76Comments

mhartington picture mhartington  路  75Comments

DanailMinchev picture DanailMinchev  路  78Comments

pavimus picture pavimus  路  90Comments