FireSQL icon indicating copy to clipboard operation
FireSQL copied to clipboard

Unable to compile using TypeScript

Open agordeev opened this issue 4 years ago • 3 comments

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.

agordeev avatar Oct 15 '19 13:10 agordeev

having same isuss need guide asap import { SQL_Value, SQL_AggrFunction } from './sql-parser';

cyiboy avatar Nov 26 '19 11:11 cyiboy

@cyiboy unfortunately this repo seems dead :(

agordeev avatar Nov 26 '19 14:11 agordeev

Hello @cyiboy @agordeev ! I've tried, and it works for me, edit the line in the utils.d.ts file to: import { SQL_Value, SQL_AggrFunction } from './types/sql-parser'; I know this isn't the right way but I needed to compile :D

ezequielpablo avatar Jul 17 '20 11:07 ezequielpablo