Ngx-datatable: ERROR in There is no format with import statements in 'C:/ANGULAR/project-angular/node_modules/@swimlane/ngx-datatable' entry-point

Created on 31 May 2019  路  31Comments  路  Source: swimlane/ngx-datatable

After enabled Ivy :

"angularCompilerOptions": {
"enableIvy": true,
"allowEmptyCodegenFiles": true
}

Error:

ERROR in There is no format with import statements in 'C:/ANGULAR/azi/node_modules/@swimlane/ngx-datatable' entry-point.

Bug

Most helpful comment

Could someone come up with a time-scale on this? 24 days for such a critical issue is more than enough and this bug has to be addressed as quickly as possible. If bugs are not getting fixed in reasonable amount of time then moving to another similar package is the only remaining option.

All 31 comments

Refer to https://github.com/angular/angular/issues/29564 for more information; this affects multiple packages with ivy

Looks like this affects multiple angular libraries that don't use angular cli. We plan to migrate ngx-datatable to angular cli soon, so that should resolve this issue. If anyone knows how to do a quick fix to enable ivy until then, a PR is welcome.

I like "soon" in your comment. we use ngx-datatable vastly in our project. the project upgraded to V8 with no problem but we couldn't enable Ivy for the exact same reason.

@marjan-georgiev great to hear! we use the library alot so its great to hear that the upgrade will come soon. Do you have an ETA or something? Btw, amazing work you guys do :D

ERROR in node_modules/@swimlane/ngx-datatable/release/datatable.module.d.ts(1,22): error TS-996002: Appears in the NgModule.imports of MyModule, but could not be resolved to an NgModule class

I managed to get around this issue by extracting the src folder and including it as a regular module in my lib until swimlane publishes a new version.

However, now that the build will run - we learn that IVY doesn't like this stuff:

  @Input()
  @ContentChild(DataTableFooterTemplateDirective, {
    read: TemplateRef,
    static: false
  })
  template: TemplateRef<any>;

ERROR in Cannot combine @Input decorators with query decorators

This occurs in:
footer.directive.ts
column.directive.ts
body-group-header.directive.ts
row-detail.directive.ts

removing @Input() before each @ContentChild solves this, but I assume this will prevent the template overrides from working (??) whatever, removing them gets you past any data-table issues so you can fix other stuff while we wait.

@WillHall thank you for looking into that. I am guessing we can split those into two separate properties.

@WillHall looks like this has already been looked at by @alxhub and there's a PR for it here: https://github.com/swimlane/ngx-datatable/pull/1660

I have the error in version 15.0.2

Installing :
console npm install @angular/compiler-cli@next
seems to resolve the issue.

Update
I creates another issue :(

I wanted to test Ivy but got the same issue with "@swimlane/ngx-datatable": "^15.0.2"

same here, you need to make a fix asap

Could someone come up with a time-scale on this? 24 days for such a critical issue is more than enough and this bug has to be addressed as quickly as possible. If bugs are not getting fixed in reasonable amount of time then moving to another similar package is the only remaining option.

@marjan-georgiev any news?

I updated to version 15.0.2, but the error continues, news?

Any solution for this problem??

i think they are being fixed https://github.com/angular/angular/issues/29564 an d https://github.com/angular/angular/issues/31394 . After today's angular's update many issues seemed fixed, but there is one last issue affecting many packages

Thank you to ngx-datatable team for the continued work. As far as I can tell currently this is still broken with version _ngx-datatable_ 15.0.2 and with _Angular_ enabled with Ivy (8.2.0-next.1).

Error:

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

It's possible that fixing it is not too bad:
https://github.com/angular/angular/issues/29564#issuecomment-480730674

The fix is that the package author needs to export this type publicly, e.g.re- export it from the release/datatable.module.d.ts file.

It's possible that a solution can come from using ng-packagr:
https://github.com/angular/angular/issues/29564#issuecomment-480472933

Since _Ivy_ is still an experimental feature not to be released officially until October / November 2019 we still have a lot of time before it's really pressing to fix. But a fix before then would be very appreciated 馃檱

I tried again today with the latest:

  • Angular 9.0.0-next.0
  • AngularCLI 8.3.0-next.0

No success:

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

馃し鈥嶁檪

Tried again today with the latest:

  • Angular 9.0.0-next.2
  • AngularCLI 8.3.0-next.1
  • Angular/compiler-cli 9.0.0-next.2

No success:

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

馃槥

Tried again today with the latest:

  • Angular 9.0.0-next.3
  • AngularCLI 9.0.0-next.1
  • Angular/compiler-cli 9.0.0-next.3
  • Angular-devkit/build-angular 0.900.0-next.1
  • swimlane/ngx-datatable 15.0.2

I do not get the above error, so there's definitely _some_ progress, though I'm unclear yet what the build error I get now means 馃槄 Will report back after further investigation.

This should be fixed in 16.0.0. Could someone verify please?

I am unsure whether something has been fixed or our project has troubles of its own. With _ngx-datatable_ 16.0.0 I am getting almost the same error as before when running versions from 23 days ago (see above comment). Now I'm getting a few errors like this (for every Module that imports ngx-datatable):

node_modules/@swimlane/ngx-datatable/lib/ngx-datatable.module.d.ts(2,22): error TS-996002: Appears in the NgModule.imports of AdminModule, but could not be resolved to an NgModule class

I wish someone else can confirm -- in our project with the _latest_ versions of _angular_ and 16.0.0 I get this error now:

An unhandled exception occurred: Cannot destructure property `createHash` of 'undefined' or 'null'.
See "/private/var/folders/32/pqw73fv945dcd6n_g619n7f8c_tzhw/T/ng-qSFBT3/angular-errors.log" for further details.

Above .log file:

[error] TypeError: Cannot destructure property `createHash` of 'undefined' or 'null'.
    at Object.<anonymous> (/Users/byakubchik/Desktop/WIP/angular8/node_modules/mini-css-extract-plugin/dist/index.js:22:9)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/byakubchik/Desktop/WIP/angular8/node_modules/mini-css-extract-plugin/dist/cjs.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/styles.js:14:30)
    at Module._compile (internal/modules/cjs/loader.js:776:30)

i get
Error: Failed to find '@swimlane/ngx-datatable/release/index.css'
after installing 16.0.0
I don't see release folder at all!!!

@mhadji see https://github.com/swimlane/ngx-datatable/issues/1741

I released a fix in 16.0.1. There is no release folder any more, everything is in the root, and some paths have changed, hence the major version.

I'm still debugging issues with _angular-cli_ (https://github.com/angular/angular/issues/32466) ... but with 16.0.2 and a manual update of webpack and webpack-dev-server I am getting to a new 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:28622:31
    at Array.forEach (<anonymous>)
    at DirectiveBinder.visitElementOrTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28605:29)
    at DirectiveBinder.visitElement (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28579:76)
    at Element.visit (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:4159:71)
    at /Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28651:67
    at Array.forEach (<anonymous>)
    at DirectiveBinder.visitElementOrTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28651:27)
    at DirectiveBinder.visitElement (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28579:76)
    at Element.visit (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:4159:71)
    at /Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28651:67
    at Array.forEach (<anonymous>)
    at DirectiveBinder.visitElementOrTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28651:27)
    at DirectiveBinder.visitTemplate (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28580:78)
    at Template.visit (/Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:4177:72)
    at /Users/byakubchik/Desktop/WIP/angular8/node_modules/@angular/compiler/bundles/compiler.umd.js:28651:67

I'll keep debugging 馃し鈥嶁檪

Hello!
Works fine to me when I updated to the last version, with Ivy enabled.

"@angular/core": "^8.2.14"
"@swimlane/ngx-datatable": "^16.0.2"

Thank You all!

Sorry I forgot to update this issue -- I was able to get ngx-datatable to work with Angular Ivy sometime earlier this month 馃憣 I strongly suspect the issue is solved 馃憤

I just upgraded our app from angular 7 to angular 9. Both dev and prod builds are fine. But when I run it, I get this error. And I'm doing just "ng serve", not sure why it says production use case. I also tried "ng serve --aot", still same error. I'm on 9.0.0-rc.9 version.
Anyone else getting this error after an upgrade?

ERROR Error: Angular JIT compilation failed: '@angular/compiler' not loaded!

  • JIT compilation is discouraged for production use-cases! Consider AOT mode instead.
  • Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?
  • Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.
    at getCompilerFacade (core.js:535)
    at Function.get (core.js:12193)
    at getInjectableDef (core.js:322)
    at R3Injector.push../node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js.R3Injector.get (core.js:12494)
    at injectInjectorOnly (core.js:785)
    at 傻傻inject (core.js:790)
    at Object.WhMessageHandlerService_Factory [as factory] (wheels-wh-common-service.js:582)
    at R3Injector.push../node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js.R3Injector.hydrate (core.js:12684)
    at R3Injector.push../node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js.R3Injector.get (core.js:12507)
    at injectInjectorOnly (core.js:785)

It seem besy way to use this library in angular 9+ is disabling Ivy renderer.
For this you can look at https://angular.io/guide/ivy#opting-out-of-ivy-in-version-9

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IngoManthey picture IngoManthey  路  3Comments

mmrath picture mmrath  路  3Comments

Csirme picture Csirme  路  3Comments

rotemx picture rotemx  路  3Comments

Matthi0uw picture Matthi0uw  路  3Comments