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

createNewSpreadsheetDocument 400 bad request 4.1.2 #697

Open
Ivokato opened this issue Jul 31, 2024 · 2 comments
Open

createNewSpreadsheetDocument 400 bad request 4.1.2 #697

Ivokato opened this issue Jul 31, 2024 · 2 comments

Comments

@Ivokato
Copy link

Ivokato commented Jul 31, 2024

After updating my dependencies I got an inexplicable ERR_BAD_REQUEST (400) response when trying to create new google spreadsheets through createNewSpreadsheetDocument. I tried doing the same from RunKit (where every npm module is installed) and there it did work with the same input. When I learnt that the RunKit uses 4.1.1 instead of 4.1.2 I downgraded my local package version and my issue was resolved. Here is my minimal reproduction code:

var {JWT} = require("google-auth-library");
var {GoogleSpreadsheet} = require("google-spreadsheet")

const key = '-----BEGIN PRIVATE KEY-----insert-your-actual-key-----END PRIVATE KEY-----\n';

const auth = new JWT({
  email: '[email protected]',
  key,
  scopes: [
    'https://www.googleapis.com/auth/spreadsheets',
    'https://www.googleapis.com/auth/drive.file',
  ],
});

GoogleSpreadsheet.createNewSpreadsheetDocument(auth, {title: 'test'}).then(console.log).catch(e => console.log('error', e));
@theoephraim
Copy link
Owner

Oh! Very weird. I’ll take a look. Thanks!

@theoephraim
Copy link
Owner

@Ivokato - I suspect this may have been related to #701
Please give the latest version a try!

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

2 participants