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

Property 'on' does not exist on type 'GaxiosPromise<Schema$File>' #2887

Closed
bl4ckck opened this issue Jan 23, 2022 · 1 comment
Closed

Property 'on' does not exist on type 'GaxiosPromise<Schema$File>' #2887

bl4ckck opened this issue Jan 23, 2022 · 1 comment
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@bl4ckck
Copy link

bl4ckck commented Jan 23, 2022

Environment details

  • OS: Ubuntu 20.04 LTS
  • Node.js version: 16.13.1
  • npm version: 8.1.2
  • googleapis version: ^39.2.0

Steps to reproduce

  1. I follow exactly like this code snippet https://developers.google.com/drive/api/v3/manage-downloads#node.js on Next js API project
  2. But the props 'on' is not found, pipe too
@bl4ckck bl4ckck added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 23, 2022
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Apr 23, 2022
@sofisl
Copy link
Contributor

sofisl commented Jul 15, 2022

Hi @bl4ckck,

I followed the code in the snippet, but I was unable to reproduce your issue. However, I did need to change a few things in order for it to work:

  1. I needed to authenticate appropriately, as it says in the sample: // TODO (developer) - Use appropriate auth mechanism for your app. I did it like so:
 const {authenticate} = require('@google-cloud/local-auth');
  const {google} = require('googleapis');

  const auth = await authenticate({
    keyfilePath:
      'path-to-oath2-credentials',
    scopes: ['https://www.googleapis.com/auth/drive'],
  });
  google.options({auth});

  const service = google.drive({version: 'v3', auth});
  1. It seems that files.get only applies to binary content, i.e., not docs files (something like a PDF). For that, you'd want to use export.

Feel free to paste your code here to see if I can reproduce better, in case there are any differences.

@sofisl sofisl closed this as completed Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants