angular2-google-maps not work with Angular 4 AOT build
See original GitHub issueI’m using the new angular 4 quickstart seed app: https://angular.io/docs/ts/latest/guide/setup.html
I’m running an npm build:aot in git bash and I get the following bash error:
“‘AgmCoreModule’ is not exported by node_modules/angular2-google-maps/core/index.js”
Version of angular 2 google maps: “angular2-google-maps”: “^0.17.0”,
My home module thats using it:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AgmCoreModule } from 'angular2-google-maps/core/index.js';
import { HomeComponent } from './home.component';
@NgModule({
imports: [CommonModule, AgmCoreModule.forRoot({apiKey: 'xxx'})],
declarations: [HomeComponent],
exports: [HomeComponent]
})
export class HomeModule { }
This is my systemjs.config:
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
'app': 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'angular2-google-maps': 'npm:angular2-google-maps/core'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
defaultExtension: 'js',
meta: {
'./*.js': {
loader: 'systemjs-angular-loader.js'
}
}
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
AOT Compilation is not worked. · Issue #629
Issue description angular2-google-maps does not work in the AOT compile. Steps to reproduce and a minimal demo of the problem step 1.
Read more >Angular Universal does not work with Angular Google Maps
1. Install global dependencies. I have installed: · 2. Create a new Angular project ng new angular-agm · 3. Add Angular universal ng...
Read more >Ahead-of-time (AOT) compilation
When you run the ng build (build only) or ng serve (build and serve locally) CLI commands, the type of compilation (JIT or...
Read more >The RxJS library
RxJS provides an implementation of the Observable type, which is needed until the type becomes part of the language and until browsers support...
Read more >ng build
Option Description Value Type Default Value
‑‑aot Build using Ahead of Time compilation. boolean true
‑‑base‑href Base url for the application being built. string
‑‑delete‑output‑path Delete...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please read the docs angular-cli is not related to this repo so I suggest you to stop offtopic
i do an ng build --prod --aot --output-hashing=none which creates the dist folder for production release fine. Next I want to serve that dist folders index to check the aot performance