Skip to content

Unable to compile using TypeScript #18

Description

@agordeev

I'm trying to use FireSQL with code from README, but getting errors below:

> tsc

node_modules/firebase/index.d.ts:6297:36 - error TS2304: Cannot find name 'ServiceWorkerRegistration'.

6297     useServiceWorker(registration: ServiceWorkerRegistration): void;
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/firebase/index.d.ts:6414:13 - error TS2304: Cannot find name 'Blob'.

6414       data: Blob | Uint8Array | ArrayBuffer,
                 ~~~~

node_modules/firesql/utils.d.ts:1:45 - error TS7016: Could not find a declaration file for module './sql-parser'. '/Users/andrey/Documents/MyProjects/FreelanceJobs/FreelanceJobs-server/functions/node_modules/firesql/sql-parser/index.js' implicitly has an 'any' type.

1 import { SQL_Value, SQL_AggrFunction } from './sql-parser';
                                              ~~~~~~~~~~~~~~

src/repositories/upwork/upworkJobRepository.ts:4:1 - error TS6133: 'firebase' is declared but its value is never read.

4 import firebase from 'firebase/app'
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 4 errors.

The code is:

import 'firebase/firestore'
import firebase from 'firebase/app'
import { FireSQL } from 'firesql'

    const fireSQL = new FireSQL(this.getCollectionRef().firestore)
    const promise = fireSQL.query(`
  SELECT *
  FROM upworkjobs
  WHERE budget >= 500 AND budget <= 10000 AND subcategory = 'Game Development'
  ORDER BY datePosted DESC
  LIMIT 5
`)

How to fix them? I use TypeScript.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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