Skip to content

X [ERROR] TS2304: Cannot find name 'Nil'. [plugin angular-compiler] #76

@sysmat

Description

@sysmat

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/voznik/ngx-odm/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:

Current behavior

  • when npm start, I get error:
X [ERROR] TS2304: Cannot find name 'Nil'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:10:29:
      10 │     function keys<T>(object: Nil | T): Array<StringifiedKey<T>>;
         ╵                              ~~~


X [ERROR] TS2304: Cannot find name 'StringifiedKey'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:10:45:
      10 │     function keys<T>(object: Nil | T): Array<StringifiedKey<T>>;
         ╵                                              ~~~~~~~~~~~~~~


X [ERROR] TS2304: Cannot find name 'Nil'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:11:39:
      11 │ ...tion keysOfNonArray<T>(object: Nil | T): Array<StringifiedKey<T>>;
         ╵                                   ~~~


X [ERROR] TS2304: Cannot find name 'StringifiedKey'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:11:55:
      11 │ ...tion keysOfNonArray<T>(object: Nil | T): Array<StringifiedKey<T>>;
         ╵                                                   ~~~~~~~~~~~~~~


X [ERROR] TS2304: Cannot find name 'ObjectIteratee'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:12:44:
      12 │ ...Own<T>(object: T, iteratee: ObjectIteratee<T, boolean | void>): T;
         ╵                                ~~~~~~~~~~~~~~


X [ERROR] TS2304: Cannot find name 'ObjectIteratee'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:13:54:
      13 │ ...ray<T>(object: T, iteratee: ObjectIteratee<T, boolean | void>): T;
         ╵                                ~~~~~~~~~~~~~~


X [ERROR] TS2304: Cannot find name 'Nil'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:14:31:
      14 │     function forEach<T extends Nil | readonly any[]>(array: T, ite...
         ╵                                ~~~


X [ERROR] TS2304: Cannot find name 'ArrayIteratee'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:14:73:
      14 │ ...y[]>(array: T, iteratee: ArrayIteratee<NonNullable<T>[number], ...
         ╵                             ~~~~~~~~~~~~~


X [ERROR] TS2536: Type 'number' cannot be used to index type 'NonNullable<T>'. [plugin angular-compiler]

    node_modules/@ngx-odm/rxdb/utils/lib/utils.d.ts:14:87:
      14 │ ...eratee: ArrayIteratee<NonNullable<T>[number], boolean | void>): T;
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~


X [ERROR] TS2304: Cannot find name 'ObjectIteratee'. [plugin angular-compiler]

Expected behavior

  • ng compile to work

Minimal reproduction of the problem with instructions

  • install: npm install @ngx-odm/rxdb
  • adding to ng config:
 provideRxDatabase(
      getRxDatabaseCreator({
        name: 'demo',
        localDocuments: true,
        multiInstance: true,
        ignoreDuplicate: false,
        allowSlowCount: true,
        // storage: getRxStorageDexie(), // INFO: can be ommited, will be provide by `storageType` string
        options: {
          plugins: [
            // will be loaded by together with core plugins
            RxDBDevModePlugin,
            RxDBAttachmentsPlugin,
            RxDBLeaderElectionPlugin,
          ],
          storageType: localStorage['_ngx_rxdb_storage'] ?? 'dexie',
          dumpPath: 'assets/data/db.dump.json',
        },
      })
    ),

Note: Our policy is that issues reported without a reproduction will be closed immediately and then reopened once a reproduction has been provided. Please respect the developers of this project by doing this. We give of our personal time to work on this project and would rather be spending our time fixing or enhancing the library than chasing down badly described or unreproducable issues.
Please delete this note once you have read it.

What is the motivation / use case for changing the behavior?

Environment


Libs:
- @angular/core version: 17.3.3
- @ngx-odm/rxdb version: 6.0.1
"typescript": "~5.4.4"


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: v20.12.0
- Platform:  Windows

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions