angular: postinstall ivy ngcc error there is no format with import statements xxx entry-point
đ bug report
Affected Package
Caused by packages/compiler-cli/ngcc/src/packages/dependency_resolver.ts
Description
At postinstall ngcc throw âimports|entry-pointsâ errors on 3th party lib. By example with angular-tree-component and ngx-virtual-scroller 3th party lib.
đŹ Minimal Reproduction
Simply run command:
ng new ap --minimal --defaults --skipInstall --enable-ivy && cd ap && npm i angular-tree-component && npm i ngx-virtual-scroller && npm install
At postinstall console will throw for
-
angular-tree-component : Entry point âangular-tree-componentâ contains deep imports into 'lodash/*âŠ
-
ngx-virtual-scroller : Error: There is no format with import statements in âC:/âŠ/node_modules/ngx-virtual-scrollerâ entry-point.
đ Your Environment
Angular CLI: 8.0.0-beta.10
Node: 11.12.0
OS: win32 x64
Angular: 8.0.0-beta.10
animations, cli, common, compiler, compiler-cli, core, forms,
language-service, platform-browser, platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.0-beta.10
@angular-devkit/build-angular 0.800.0-beta.10
@angular-devkit/build-optimizer 0.800.0-beta.10
@angular-devkit/build-webpack 0.800.0-beta.10
@angular-devkit/core 8.0.0-beta.10
@angular-devkit/schematics 8.0.0-beta.10
@ngtools/webpack 8.0.0-beta.10
@schematics/angular 8.0.0-beta.10
@schematics/update 0.800.0-beta.10
rxjs 6.4.0
typescript 3.3.4000
webpack 4.29.6
cc @filipesilva
update1: improve issue style
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 19
- Comments: 66 (28 by maintainers)
@petebacondarwin Iâm the author of ag-grid-angular - please let me know if I can help with this
and @swimlane/ngx-datatableâ
We have not yet implemented CommonJS/UMD support, which is the common issue here. I will post an update here when that happens.
Iâm having the same issue with latest versions of ag-grid-angular and ngx-cookie-service packages. @CunningFatalist @seanlandsman
Confirming retrieving a recent build fixes the issue for
angular2-signaturepad
(https://github.com/wulfsolter/angular2-signaturepad/issues/78) I hope you can get #30591 merged in a proper release soon đIt seems that
angular2-text-mask
suffers from this too. Iâve opened an issue on that repo: https://github.com/text-mask/text-mask/issues/930Tracking these packges here: https://hackmd.io/EgzwJ8Q3QaKIO1bWh1yrvA
@petebacondarwin nevermind. I think I figured it out. I came across https://github.com/ng-packagr/ng-packagr which seems to fix my npm package format.
@wottpal you issue does indeed appear to have the same cause as #31394. Please follow that issue for a resolution.
@kschwidder - please can you create a new issue for you problem, providing steps to reproduce the error.
I am closing this issue as it is becoming a catch-all for ngcc related issues and that makes it difficult to track what is broken and what is fixed. Please create new issues for failures when trying out ivy/ngcc (after searching for duplicate issues first!).
These runtime errors might be related to #31394.
@petebacondarwin Yes, I can confirm that as well. Error and Warning are gone.
Update: Even though it compiles now I get a Runtime-Error in Chrome (also from ng-inline-svg). Seems related:
(If you are wondering
experimentalDecorators
is set totrue
in mytsconfig.json
, of course)Iâve tried Ivy a few minutes ago (it failed to compile):
My environment:
My original problem was
angular2-text-mask
: https://github.com/angular/angular/issues/29564#issuecomment-492248090. This time it passed, but with some warnings:The main problem was
@angular/flex-layout
, but itâs already being tracked by another opened issue: https://github.com/angular/angular/issues/30114+1: with 8.2.0-next.0 it is fixed !!! The decrease of the bundle size is amazing ! Awesome work. Well done. Thx a lot
@wottpal - This should be fixed. Can you confirm which version of Angular you are testing against? The ngcc fixes are only in the
next
versions, which currently is 8.2.0-next.0 (released yesterday).@kschwidder - the version to use for testing ivy is 8.1.0-rc.0 and higher.
Running the latest release 8.0.3
ERROR in ./node_modules/@angular/flex-layout/ivy_ngcc/esm2015/extended.js 133:578 Module parse failed: Unexpected token (133:578) You may need an appropriate loader to handle this file type. | } | }
ERROR in ./node_modules/@angular/flex-layout/ivy_ngcc/esm2015/extended.js 133:578 Module parse failed: Unexpected token (133:578) You may need an appropriate loader to handle this file type. | } | }
@julianobrasil - Iâll email you.
did you mean :
"@angular/compiler-cli": "https://github.com/angular/compiler-cli-builds",
@petebacondarwin@webcat12345 and @bunnyvishal6 et al - v8.0.0 does not include important changes to ngcc that probably support your use cases. You need to use a version built from the
master
branch. E.g.Same issue with :
Angular: 8.0.0-rc.0
andngx-cookie-service
@gkalpak same as @istiti,
8.0.0-beta.13
@gkalpak I can confirm same beahvior with
Angular: 8.0.0-beta.13 & (CLI beta.16)
Thx for reporting @thomasoreilly, @fclemonschool, @vanelizarov. I have updated the tracking doc. (For anyone reporting these, it would be useful to also mention the latest Angular version tried.)
Sadly, no - the imports in the
.d.ts
files are incomplete, and only reflect the type side of the program.@speige correct, error is gone
@petebacondarwin it seems Angular compiler failed to compile with first error too (angular-tree-component) I get :
In the latter case (
Error: There is no format with import statements in 'C:/.../node_modules/ngx-virtual-scroller' entry-point.
) we need a format to have import statements so that we can work out the dependencies between entry-points (and packages). This is because we must compile them in order (most dependended upon first).It looks like this package only exposes one entry-point format via
"main": "dist/virtual-scroller.js",
. Looking at that file, this appears to be a CommonJS format. This format is on our roadmap to support - it is related to UMD, which is also on the roadmap.That being said, I wonder if we could use
.d.ts
typings files to work out these dependencies đ€