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

Ionic build failed when using shared module .

Open macdosi opened this issue 10 years ago • 3 comments

Ionic version: (check one with "x") [ ] 1.x [X ] 2.x

I'm submitting a ... (check one with "x") [X ] bug report [ ] feature request

Current behavior: I have an ionic2 app , and a Shared Module written in angular2 typescript , the shared module is simple one component . in my main app.module I've imported the shared module and ionic:serve wirks fine I can see the component . as I run ionic build android I get an error

[11:38:43] Error: Unexpected value 'MyModule' imported by the module 'AppModule' [11:38:43] ngc failed [11:38:43] ionic-app-script task: "build" [11:38:43] Error: Error

Expected behavior: Build should work fine

Steps to reproduce: Create an ionic 2 quick start project (project A) by running ionic start cutePuppyPics --v2 Create a separate angular2 shared module project - I've cloned https://github.com/driftyco/ionic-module-template Install it using npm install ionic-module-template in project A . Import the module inside app.module , run npm run ionic:serve see it working , call ionic build android see it failing .

Other information: I've followed instructions of http://blog.angular-university.io/angular2-ngmodule/ And used https://github.com/driftyco/ionic-module-template With changes that should support AOT

macdosi avatar Nov 20 '16 10:11 macdosi

Hello, thanks for using Ionic! You can take a look at our module template to see how to make a module that is AOT compatible. Hopefully that helps!

jgw96 avatar Nov 22 '16 18:11 jgw96

Hello! Thanks for opening an issue with us! As this seems like more of a support question i will urge that you ask this question on our forum or on our slack channel. Thanks for using Ionic!

jgw96 avatar Dec 05 '16 16:12 jgw96

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.

ionitron-bot[bot] avatar Sep 06 '18 01:09 ionitron-bot[bot]