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

firebase deploy error TS1005 #5486

Closed
nchitnis1 opened this issue Feb 2, 2023 · 2 comments
Closed

firebase deploy error TS1005 #5486

nchitnis1 opened this issue Feb 2, 2023 · 2 comments

Comments

@nchitnis1
Copy link

I am following the instructions from https://firebase.google.com/docs/ml/ios/recognize-text.

I tried this on the Mac, and also on Windows 10, with exactly the same results.

git clone https://github.com/firebase/functions-samples
cd vision-annotate-images
cd functions
npm install
cd ..
firebase init
firebase deploy --only functions:annotateImage

The output has 136 errors, I am showing just the top few:


=== Deploying to 'myprogram'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint C:\firebase\functions-samples\vision-annotate-images\functions
> eslint "src/**/*"

Running command: npm --prefix "$RESOURCE_DIR" run build

> functions@ build C:\firebase\functions-samples\vision-annotate-images\functions
> tsc

node_modules/@firebase/util/dist/util-public.d.ts:496:91 - error TS1005: ',' expected.

496 export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined;
                                                                                              ~
node_modules/@firebase/util/dist/util-public.d.ts:496:105 - error TS1005: ',' expected.

496 export declare const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined;
                                                                                                            ~
node_modules/@firebase/util/dist/util-public.d.ts:512:103 - error TS1005: ']' expected.

512 export declare const getExperimentalSetting: <T extends ExperimentalKey>(name: T) => FirebaseDefaults[`_${T}`];
                                                                                                          ~~~~
node_modules/@firebase/util/dist/util-public.d.ts:512:110 - error TS1005: ';' expected.

512 export declare const getExperimentalSetting: <T extends ExperimentalKey>(name: T) => FirebaseDefaults[`_${T}`];

The rest of the errors have been truncated

@taeold
Copy link
Contributor

taeold commented Feb 3, 2023

@nchitnis1 Thanks for the feedback. It turns out the issue is with old typescript version included in the sample.

To workaround the issue, try installing the latest version of typescript:

npm i --save-dev typescript@latest

I also sent PR to the samples repo to fix the issue upstream.

@nchitnis1
Copy link
Author

I reinstalled everything and added the changes made above, and it works now. Thanks.

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

No branches or pull requests

4 participants