l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.57k stars 487 forks source link

angular-datatables has no exported member #1691

Closed wjun20314 closed 1 year ago

wjun20314 commented 1 year ago

I started my new project, I tried to compile but it failed to compile.

Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:256:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

256     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ApplicationInitStatus, [{ optional: true; }]>;
                            ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:257:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

257     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ApplicationInitStatus>;
                             ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:272:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

272     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ApplicationModule, never>;
                            ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:273:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵNgModuleDeclaration'.

273     static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<ApplicationModule, never, never, never>;
                            ~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:274:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectorDeclaration'.

274     static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<ApplicationModule>;
                            ~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:440:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

440     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ApplicationRef, never>;
                            ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:441:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

441     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ApplicationRef>;
                             ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:786:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

786     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<Compiler, never>;
                            ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:787:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

787     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<Compiler>;
                             ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:5019:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

5019     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<PlatformRef, never>;
                             ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:5020:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

5020     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<PlatformRef>;
                              ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:6405:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

6405     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<SystemJsNgModuleLoader, [null, { optional: true; }]>;
                             ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:6406:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

6406     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<SystemJsNgModuleLoader>;
                              ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:6602:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

6602     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<Testability, never>;
                             ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:6603:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

6603     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<Testability>;
                              ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:6647:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

6647     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<TestabilityRegistry, never>;
                             ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:6648:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

6648     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<TestabilityRegistry>;
                              ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:9546:25 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.

9546     static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ɵConsole, never>;
                             ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/node_modules/@angular/core/core.d.ts:9547:26 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.

9547     static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ɵConsole>;
                              ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/src/angular-datatables.directive.d.ts:39:21 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.

39     static ɵfac: i0.ɵɵFactoryDeclaration<DataTableDirective, never>;
                       ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/src/angular-datatables.directive.d.ts:40:21 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/core"' has no exported member 'ɵɵDirectiveDeclaration'.

40     static ɵdir: i0.ɵɵDirectiveDeclaration<DataTableDirective, "[datatable]", never, { "dtOptions": "dtOptions"; "dtTrigger": "dtTrigger"; }, {}, never, never, false>;
                       ~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/src/angular-datatables.module.d.ts:13:21 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.

13     static ɵfac: i0.ɵɵFactoryDeclaration<DataTablesModule, never>;
                       ~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/src/angular-datatables.module.d.ts:14:21 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.

14     static ɵmod: i0.ɵɵNgModuleDeclaration<DataTablesModule, [typeof i1.DataTableDirective], [typeof i2.CommonModule], [typeof i1.DataTableDirective]>;
                       ~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angular-datatables/src/angular-datatables.module.d.ts:15:21 - error TS2694: Namespace '"C:/Users/w_jun/Documents/Project ERP/erpsys/node_modules/angular-datatables/node_modules/@angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.

15     static ɵinj: i0.ɵɵInjectorDeclaration<DataTablesModule>;

mycomponent.ts

constructor(private http: HttpClient) {}

  allUsers: any = [];
  users() {
    this.http.get('https://jsonplaceholder.typicode.com/users').subscribe((response: any) => {
      this.allUsers = response.data;
    });
  }

mypage.html

<div class="container">
  <div class="card m-5 p-3">
      <div class="card-body">
          <table class="table table-bordered table-striped table-hover">
              <thead>
              <tr>
                  <th>ID</th>
                  <th>Name</th>
                  <th>Username</th>
                  <th>Email</th>
                  <th>Phone number</th>
                  <th>Address</th>
              </tr>
              </thead>
              <tbody>
              <tr *ngFor="let user of allUsers">
                  <td>{{ user.id }}</td>
                  <td>{{ user.name }}</td>
                  <td>{{ user.username }}</td>
                  <td>{{ user.email }}</td>
                  <td>{{ user.phone }}</td>
                  <td>{{ user.address.street }}, {{ user.address.city }}</td>
              </tr>
              </tbody>
          </table>
      </div>

  </div>
</div>
shanmukhateja commented 1 year ago

Hi,

Can you provide a small, reproducible repo to investigate this?

shanmukhateja commented 1 year ago

I was able to reproduce the issue with #1692 The issue happens with fresh install of angular-datatables@14.0.0 however it doesn't happen if I used a local build of the library (using install-local).

I tried using Node v14 and v16 and the problem still occurs.

@l-lin maybe CI build differs somehow? Any ideas how to investigate this?

l-lin commented 1 year ago

The only difference is that the Github action is using a node version 12 as you see here.

Let's see if switching to version 16 changes anything. I'll release a 14.0.1 to test it out.

l-lin commented 1 year ago

Unfortunately, it does not seem to mitigate the issue, although when I start a new angular project with newest angular/cli (v15), I do not reproduce the issue. Interesting behavior...

Another thing I notice in the sample provided in #1692 is the fact angular-datatables has a dependency to codelyzer which depends on angular 9:

➜ npm list --depth=10 | grep -A 5 angular-datatables
dt-poc@0.0.0 /home/l-lin/tmp/foobar/angular-datatables-bugged
├── __ngcc_entry_points__.json@ extraneous
├─┬ @angular-devkit/build-angular@14.2.10
│ ├─┬ @ampproject/remapping@2.2.0
│ │ ├─┬ @jridgewell/gen-mapping@0.1.1
│ │ │ ├── @jridgewell/set-array@1.1.2
--
├─┬ angular-datatables@14.0.1
│ └─┬ codelyzer@6.0.2
│   ├─┬ @angular/compiler@9.0.0
│   │ └── tslib@1.14.1 deduped
│   ├─┬ @angular/core@9.0.0
│   │ ├── rxjs@6.6.7 deduped

It seems the dependency has been added by this commit. @shanmukhateja, do we need this dependecy? I feel like this issue is linked to this version conflict (same issue as this stackoverflow question.

l-lin commented 1 year ago

v14.0.2 has been released and should fix this issue.