I’m trying to setup angular2-google-maps component for ionic2 app, but getting error on build.
ngc error: Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in E:/node/hotby.me/ionic2-angular2-google-maps-example/.tmp/app/app.module.ts, resolving symbol AppModule in E:/node/hotby.me/ionic2-angular2-google-maps-example/.tmp/app/app.module.ts
Can someone help me please?
Here is the module definition file
And here is full project repo, which is just ionic2 blank template with modified app.module.ts fil
Ok, I’ve finally managed to run the angular2-google-maps in my app.
The issue was is caused by Angular2 ahead of time compiler and angular2-google maps incompatibility.
If anyone will have same issue, here are the steps I’ve done, to make it work in dev environment without AoT
I’ve updated ionic build scripts lib, so now it doesn’t make AoT compiling for dev build
You need to import angular2-google-maps by following method, otherwise it doesn’t work after rollup
import { AgmCoreModule } from ‘angular2-google-maps/esm/core/index.js’;
Add the AgmCoreModule to imports field in your app module
That’s an interesting question. I don’t know, but I think that rollup has nothing to do with AoT, and the error is given during ngc task, which is AoT compilation task, and rollup comes after in bundle task