angular-google-maps: Not compatible with Ivy (experimental)
Issue description When compiling with Ivy, the compilation fails with the following error:
ERROR in src/app/app.module.ts(8,12): error TS-991010: Value at position 1 in the NgModule.importss of AppModule is not a reference: [object Object]
Steps to reproduce and a minimal demo of the problem
I could not create a stackblitz or plunker for this as it is intending to show a compiler failure and I do not know how to demonstrate this.
You can check out https://github.com/paullessing/agm-ivy-demo and attempt to build after running yarn install
.
- Install new project of Angular 8 using
ng new
- Add
@agm/core
and set up the default importimports: [ BrowserModule, AgmCoreModule.forRoot({ apiKey: environment.mapsApiKey, }) ]
- Enable Ivy in
tsconfig.app.json
:{ ... "angularCompilerOptions": { "enableIvy": true } }
- Enable AOT in
angular.json
to work around “lazy routes not found”:{ "projects": { "my-project": { "architect": { "build": { "options": { ... "aot": true, } } } } } }
- Run
ng serve
Current behavior Compile fails with error:
ERROR in src/app/app.module.ts(8,12): error TS-991010: Value at position 1 in the NgModule.importss of AppModule is not a reference: [object Object]
(Position 1 in the imports
array is the AgmCoreModule.forRoot()
)
Expected/desired behavior No compiler failures
angular2 & angular-google-maps version
"@agm/core": "1.0.0-beta.5",
Angular CLI: 8.0.1
Node: 10.16.0
OS: win32 x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.1
@angular-devkit/build-angular 0.800.1
@angular-devkit/build-optimizer 0.800.1
@angular-devkit/build-webpack 0.800.1
@angular-devkit/core 8.0.1
@angular-devkit/schematics 8.0.1
@angular/cli 8.0.1
@ngtools/webpack 8.0.1
@schematics/angular 8.0.1
@schematics/update 0.800.1
rxjs 6.4.0
typescript 3.4.5
webpack 4.30.0
Other information Compile works when Ivy is disabled.
May be related to https://github.com/angular/angular/issues/28603 which states that if the package.json
does not contain a types
or typings
property, the module will be excluded from compilation.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 14
- Comments: 54 (4 by maintainers)
I agree that this must be released ASAP. This library’s incompatibility with ivy is one of few issues left preventing us from testing ivy on our mid-scale web app.
Any updates on this issue?
after testing, #1634 does fix it so the issue is with our obsolete build system. Hopefully @SebastianM can review and merge the PR
same issue here when using latest angular beta and ivy
We have nothing against you forking and deploying our lib, that’s why it’s open source. 😄 I am trying to get it out, but it’s not as easy as ‘running a command’. I expect beta.8 to be released way before Angular 9.
I am thinking of copying this repo exactly and releasing it to npm under a different name, so everybody who watches this thread can try it out until they catch up. Anybody else thinking of doing this?
We get responses from contributors like it is not priority. I could argue that and say releasing this so it fixes AOT and Ivy support is somewhat significant. AOT has been for a while and in a couple of months time Angular 9 will be around with (expected) stable Ivy. Personally I see no reason to claim it is exactly 0 priority.
Secondly, what’s the problem with just running a command and releasing it to npm?
It is claimed by a contributor that it may not be stable yet, fine, in which case keeping beta flag makes sense. BUT! Isn’t beta suppose to be somewhat a volatile thing? Which means frequent releases are to be expected but what we see is barely one release a month. It might be a good idea to release current version as stable and the one fixing Ivy under beta flag if there are significant worries about its’ instability.
And remember ~60k people weekly can potentially benefit from a new version 😉
Thanks
@doom777 Not PRIORITY 0 CRITIAL, but very important.
Angular is about to release v9.0.0 that will enable ivy by default, and this package will be useless with this version. If the PR fixed it, I really can’t see why don’t release a new version.
Also, I see no reason to this package still being in beta. It work’s just fine here, no bugs, no instability.
Angular: 8.0.0 @agm/core: 1.0.0-beta.6
Hi, I have the same problem when Ivy is enabled : ERROR in src/app/app.module.ts(37,12): error TS-991010: Value at position 16 in the NgModule.importss of AppModule is not a reference: [object Object]
Works when Ivy is disabled
Same problem here.
Hey, everyone. I know some of you are anxious to have this fix released, but (1) I am not in charge of releasing new agm versions, (2) we released one fairly recently, and (3) Ivy is still in preview, so while it’s important for us to release support, it’s not PRIORITY 0 CRITICAL. I messaged @SebastianM about releasing a new version, and am waiting for a response.
That is literally exactly what I did in the demo project I linked in the description above.
ok, good luck. Keep in mind, it has much fewer features
I finally switched to @angular/google-maps, working great so far 😃
Here’s a PR that deals with the way decorators are present in
@agm/core
1.0.0: https://github.com/angular/angular/pull/32901@doom777 how do you know, were you the one that published the release? I don’t quite understand how the 1.0.0 release of
@agm/core
could have bothctorParameters
and__decorate
calls if it was built with anything other than ng-packagr 5.5.1.Looked into this just now,
@agm/core
1.0.0 has bundles which has decorators represented in a way that is strange to me. I’m looking into it.@SebastianM
@agm/core 1.0.0
was working fine withAngular 9.0.0-next.6
but withAngular 9.0.0-next.7
it started throwing this error again https://github.com/angular/angular/issues/32506Can you please take a look?
@SebastianM If you’re already available, can you update the stackblitz template to use latest AGM version?
Hey,
saw this thread accidentally. @Ephraim where did you send me a messsage? Maybe my push settings are messed up 😕 I can push a new version when I’m home. Sorry for the delay!
Ephraim Khantsis notifications@github.com schrieb am Mo. 16. Sep. 2019 um 17:06:
@mruknowme please don’t do that.
@doom777 was starting to do just that before there was more traction on this repo. He’s done a lot to help get the ball moving and I understand you’re not happy with the pace, but it has gotten better and forking only confuses people rather than having us all work together to try to make things faster.
Not published to npm?
Yes, I am trying to get the author of #1634 to update his PR so that we can merge it in. Hopefully next week. So far, I can’t get a response, but if that continues, I’ll clone his PR and do it myself.