waseemdev / ng-ionic-connectedanim

Connected Animation (Shared Element Transition) for Ionic Framework.
MIT License
12 stars 3 forks source link

Ionic 3 --prod error #3

Open afdoblas opened 5 years ago

afdoblas commented 5 years ago

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 commented 5 years ago

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

afdoblas commented 5 years ago

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 commented 5 years ago

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

afdoblas commented 5 years ago

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 commented 4 years ago

Any update on this?

waseemdev commented 4 years ago

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 commented 4 years ago

Nothing works man :)