Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic 3 --prod error #3

Open
afdoblas opened this issue Jul 23, 2019 · 7 comments
Open

Ionic 3 --prod error #3

afdoblas opened this issue Jul 23, 2019 · 7 comments

Comments

@afdoblas
Copy link

Hi!
Thanks for your plugin.

Its works very nice in dev, but when i try to build in prod mode the AOT return
"Error during template compile of 'ConnectedAnimationModule' Function calls are not supported in decorators in 'NgModule' 'NgModule' calls a function at @angular/core/core.ts(194,31)."

Can you help me?

@waseemdev
Copy link
Owner

Hi
I just tested it with --prod and it worked without issues.
How did you import the module and the service?

@afdoblas
Copy link
Author

Hi,

I have imported in my app.module.ts (like your example)
Here is my app.module.ts :

import { Push } from '@ionic-native/push';
import { IonicModule } from 'ionic-angular';
import { ComponentsModule } from './../components/components.module';
import { LottieAnimationViewModule } from 'ng-lottie';

import { NativeStorage } from '@ionic-native/native-storage';
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler } from 'ionic-angular';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HTTP } from '@ionic-native/http';
import { Keyboard } from '@ionic-native/keyboard';
import { Badge } from '@ionic-native/badge';
import { Vibration } from '@ionic-native/vibration';
import { ConnectedAnimationModule } from 'ng-ionic-connectedanim';

@NgModule({
declarations: [
MyApp,
HomePage,
ListPage,

],
imports: [
BrowserModule,
.......
ComponentsModule,
IonicModule.forRoot(MyApp),
ConnectedAnimationModule.forRoot()
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
NativeStorage,
Keyboard,
Badge,
Vibration,
Push,
HTTP,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}

And here is my package.json

{
"name": "Example",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"@angular/animation": "^4.0.0-beta.8",
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/badge": "^4.20.0",
"@ionic-native/core": "~4.18.0",
"@ionic-native/http": "^4.20.0",
"@ionic-native/keyboard": "^4.20.0",
"@ionic-native/native-storage": "^4.20.0",
"@ionic-native/push": "^4.20.0",
"@ionic-native/splash-screen": "~4.18.0",
"@ionic-native/status-bar": "~4.18.0",
"@ionic-native/vibration": "^4.20.0",
"@ionic/storage": "2.2.0",
"cordova-browser": "5.0.4",
"cordova-ios": "4.5.5",
"cordova-plugin-advanced-http": "2.0.6",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^3.1.2",
"cordova-plugin-nativestorage": "2.3.2",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-vibration": "^3.1.1",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-wkwebview-inputfocusfix": "^1.0.4",
"ionic-angular": "3.9.3",
"ionicons": "3.0.0",
"ng-ionic-connectedanim": "0.0.46",
"ng-lottie": "^0.3.2",
"phonegap-plugin-push": "2.2.3",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"ts-md5": "^1.2.4",
"web-animations-js": "^2.3.1",
"zone.js": "0.8.29"
},
"devDependencies": {
"@ionic/app-scripts": "^3.2.4",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-nativestorage": {},
"cordova-plugin-advanced-http": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"phonegap-plugin-push": {},
"cordova-plugin-badge": {},
"cordova-plugin-wkwebview-inputfocusfix": {},
"cordova-plugin-vibration": {}
},
"platforms": [
"ios"
]
}
}

Thanks for your help!

@waseemdev
Copy link
Owner

I've uploaded a new version, please upgrade to the latest one 0.0.47 and try again.

@afdoblas
Copy link
Author

Thanks again for your support! I have tried but it keeps on failing in --prod (plugin version 0.47)

Output:
Error during template compile of 'ConnectedAnimationModule' Function calls are not supported in decorators in 'NgModule' 'NgModule' calls a function at @angular/core/core.ts(194,31).

@ErHarinderSingh
Copy link

Any update on this?

@waseemdev
Copy link
Owner

I am very sorry for that, but as I said I can't reproduce the issue, and it works in my apps.
As a workaround, copy the whole module's source code and put it in your app.

@ErHarinderSingh
Copy link

Nothing works man :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants