Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile using TypeScript #18

Open
agordeev opened this issue Oct 15, 2019 · 3 comments
Open

Unable to compile using TypeScript #18

agordeev opened this issue Oct 15, 2019 · 3 comments

Comments

@agordeev
Copy link

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.

@cyiboy
Copy link

cyiboy commented Nov 26, 2019

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

@agordeev
Copy link
Author

@cyiboy unfortunately this repo seems dead :(

@ezequielpablo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants