Repository navigation
Description
🐞 Bug report
Command (mark with an x)
- serve
Is this a regression?
Production app builds with version 8, fails with version 9 and IVY enabled
Description
Everything in this ticket is about/with the experimental Ivy enabled.
🔬 Minimal Reproduction
Sorry unsure what the problem is. Part of the behavior is documented here:
swimlane/ngx-datatable#1699 (comment)
With AngularCLI 8.3.0-next.1
The error was:
ERROR in node_modules/@swimlane/ngx-datatable/release/datatable.module.d.ts(1,22): error TS-996002: Appears in the NgModule.imports of AdminModule, but could not be resolved to an NgModule class
But after updating, with AngularCLI 9.0.0-next.1 I get a different output I am unable to discern:
🔥 Exception or Error
ERROR in Error: Assertion error: failed to find directive with exportAs: ngForm
at /Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28444:31
at Array.forEach (<anonymous>)
at DirectiveBinder.visitElementOrTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28427:29)
at DirectiveBinder.visitElement (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28401:76)
at Element.visit (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:4132:71)
at /Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28473:67
at Array.forEach (<anonymous>)
at DirectiveBinder.visitElementOrTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28473:27)
at DirectiveBinder.visitElement (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28401:76)
at Element.visit (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:4132:71)
at /Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28473:67
at Array.forEach (<anonymous>)
at DirectiveBinder.visitElementOrTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28473:27)
at DirectiveBinder.visitTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28402:78)
at Template.visit (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:4150:72)
at /Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28473:67
🌍 Your Environment
Angular CLI: 9.0.0-next.2
Node: 12.6.0
OS: darwin x64
Angular: 9.0.0-next.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.0-next.2
@angular-devkit/build-angular 0.900.0-next.2
@angular-devkit/build-optimizer 0.900.0-next.2
@angular-devkit/build-webpack 0.900.0-next.2
@angular-devkit/core 9.0.0-next.2
@angular-devkit/schematics 9.0.0-next.2
@angular/cli 9.0.0-next.2
@angular/http 7.2.15
@ngtools/webpack 9.0.0-next.2
@nguniversal/express-engine 7.1.1
@schematics/angular 9.0.0-next.2
@schematics/update 0.900.0-next.2
rxjs 6.5.2
typescript 3.4.5
webpack 4.39.3
Anything else relevant?
Will be happy to clarify more.
The original problem preventing the app from compiling was the inclusion of three libraries
- ngx-datatable - ERROR in There is no format with import statements in 'C:/ANGULAR/project-angular/node_modules/@swimlane/ngx-datatable' entry-point swimlane/ngx-datatable#1699 (comment)
- mydatepicker - https://www.npmjs.com/package/mydatepicker (no new versions since > 1 year ago)
- ng2-charts - https://www.npmjs.com/package/ng2-charts (haven’t tried their latest version yet)
🤷♂
Tagging @StephenFluin for reference 🙇

Activity
whyboris commentedon Sep 5, 2019
I am getting very inconsistent behavior, with the latest versions (as of now) of angular and
ngx-datatable v16.0.0I get this error:Above
.logfile:9 remaining items
whyboris commentedon Sep 11, 2019
I'll try. What's puzzling are errors like
'ngClass' is not a valid property of <span>.😖I found this StackOverflow question that suggests I need
BrowserModuleandCommonModulein the right places -- but I have those 😅whyboris commentedon Sep 12, 2019
Updated to the newest versions as of now (one version up from before) and the output is more-readable, all one-liners. The first one is likely the culprit that cascades to the rest:
Seems identical to: #30972
whyboris commentedon Sep 12, 2019
I updated to TypeScript
3.5.1(and@types/node 12.7.5just in case) and the app proceeded to build (with 3 small TS errors aboutbooleanisn't assignable toneverand the like) ...But the Chrome console now shows this:
I added
// @ts-ignoreabove the 3 lines, and rannpm startagain only to get the old error output, a wall of errors like this:🤷♂ inconsistent behavior when running the app the first time (after
rm -rf node_modules && npm install && npm startvsnpm startafter I ran it once) 🤷♂I did
rm - rfagain and got only 2 errors in compilation before a wall of things like'ngClass' is not a valid property of <div>:Perhaps these two repositories will need to release a new version to fix the problem?
mydatepicker(I'm on latest and the library hasn't gotten any new versions in 1 year), andng2-chartswhyboris commentedon Sep 12, 2019
I wondered if
tsconfig.jsonneeded to have different values:I used the most current
@angular/cli@nextto generate a new project; it contained these values:Updating the failing project to these did not make a difference 🙆♂
whyboris commentedon Sep 17, 2019
@JoostK minimal reproduction: #32729 -- dealing with the trouble-causing
mydatepickerlibrarythank you for your time 🙇
compeek commentedon Sep 17, 2019
I already commented on your other issue (#32729), so but I would suggest the same things here, so please see that comment: #32729 (comment)
I am not using the same third party libraries you are, but I've had some of the same errors, such as
Appears in the NgModule.imports of AdminModule, but could not be resolved to an NgModule classandCannot read property 'incrementalState' of null.The two things I mentioned in the other issue seem to have resolved these errors for me, although I don't fully understand why.
whyboris commentedon Sep 18, 2019
@JoostK I created another minimal reproduction of the error, this time with the trouble-causing
ng2-chartslibrary: #32748JoostK commentedon Sep 18, 2019
Thanks so much @whyboris. I'm in London for Angular Connect at the moment so won't be able to look into it immediately, expect an update during the weekend.
whyboris commentedon Sep 18, 2019
Please no rush 👌at work we don't intend to upgrade to Angular 9 until at least a few months after its release.
JoostK commentedon Sep 26, 2019
Sorry, I've lost a bit track of what the state of this is now, after having diagnosed why
mydatepickerdid not work. Is this still an issue with the other date library?whyboris commentedon Sep 28, 2019
Thank you @JoostK 🙇
I think it's acceptable for new major releases of Angular to stop supporting outdated versions of libraries.
In my case there were three, each fixed with newer releases:
mydatepickerto its successorangular-mydatepicker(by the same author!) ✅ng2-chartsversion1.6.0to latest2.3.0✅ngx-datatableto16.0.1✅Had we been keeping our library versions up to date at work, we wouldn't have run into this complicated mess of errors. I hope the time everyone spent working through this and related issues wasn't wasted time 🙇
This issue can be closed if there's nothing valuable to work through. Perhaps during Angular 9 release it's worth making public that some old versions of libraries might not work and some library upgrades might be needed.
❤️
whyboris commentedon Oct 7, 2019
Confirming that after I updated the 3 libraries in my project, the app compiled with
ivyandAOT🚀If I'm doing it right, with
webpack-bundle-analyzerI get these results:5.87MB5.15MBwithivyandAOTenabled (latest versions9.0.0-next.9)angular-automatic-lock-bot commentedon Nov 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.