Closed
Description
[REQUIRED] Describe your environment
- Operating System version: Linux
- Browser version: none, I'm using nodejs
- Firebase SDK version: latest
- Firebase Product: firebase util
[REQUIRED] Describe the problem
Steps to reproduce:
Install @firebase/util and compile under node environment.
To reproduce with firebase-admin
(which has a dependency chain to @firebase/util
), you can checkout this repo: https://github.com/Ranguna/reproducing-firebase-js-sdk-6085
Relevant Code:
2d672ce#diff-b8c22a8c7d8e12d84f62d2ee45dffda84efae4b8fa6588d1aac8f0d49909fd57R33
The above line introduced the usage of DOMStringList
which is not available in node. This breaks ts compilations for firebase-admin
through this dependency chain firebase-admin -> @firebase/database-compat -> @firebase/util
.
I am now stuck with @firebase/util
< 1.5.0.
Typescript compilation result:
> tsc
node_modules/@firebase/util/dist/src/indexeddb.d.ts:19:23 - error TS2304: Cannot find name 'DOMStringList'.
19 objectStoreNames: DOMStringList;
~~~~~~~~~~~~~
node_modules/@firebase/util/dist/src/indexeddb.d.ts:20:22 - error TS2304: Cannot find name 'IDBDatabase'.
20 constructor(_db: IDBDatabase);
~~~~~~~~~~~
node_modules/@firebase/util/dist/src/indexeddb.d.ts:21:55 - error TS2304: Cannot find name 'IDBTransactionMode'.
21 transaction(storeNames: string[] | string, mode?: IDBTransactionMode): TransactionWrapper;
~~~~~~~~~~~~~~~~~~
node_modules/@firebase/util/dist/src/indexeddb.d.ts:22:52 - error TS2304: Cannot find name 'IDBObjectStoreParameters'.
22 createObjectStore(storeName: string, options?: IDBObjectStoreParameters): ObjectStoreWrapper;
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@firebase/util/dist/src/indexeddb.d.ts:28:31 - error TS2304: Cannot find name 'IDBTransaction'.
28 constructor(_transaction: IDBTransaction);
~~~~~~~~~~~~~~
node_modules/@firebase/util/dist/src/indexeddb.d.ts:33:25 - error TS2304: Cannot find name 'IDBObjectStore'.
33 constructor(_store: IDBObjectStore);
~~~~~~~~~~~~~~
node_modules/@firebase/util/dist/src/indexeddb.d.ts:35:57 - error TS2304: Cannot find name 'IDBIndexParameters'.
35 createIndex(name: string, keypath: string, options: IDBIndexParameters): IndexWrapper;
~~~~~~~~~~~~~~~~~~
node_modules/@firebase/util/dist/src/indexeddb.d.ts:43:25 - error TS2304: Cannot find name 'IDBIndex'.
43 constructor(_index: IDBIndex);
~~~~~~~~
Found 8 errors in the same file, starting at: node_modules/@firebase/util/dist/src/indexeddb.d.ts:19