-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
A screenshot that you have tested with "Try this API".
it works in node
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
the code is included
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
import { google } from "npm:[email protected]";
const auth = new google.auth.GoogleAuth({
credentials: JSON.parse(
Deno.readTextFileSync(
"server/src/integrations/google-products-api-key.json",
),
),
scopes: ["https://www.googleapis.com/auth/spreadsheets"],
});
const sheets = google.sheets({ version: "v4", auth });
const range = "Sheet1!A1";
const addRow = (
{ rowData, spreadsheetId }: {
rowData: (string | number)[];
spreadsheetId: string;
},
) =>
sheets.spreadsheets.values.append({
spreadsheetId,
range,
valueInputOption: "RAW",
requestBody: { values: [rowData] },
});
addRow({
rowData: ["Name", "Email", "Age"],
spreadsheetId: "1GeClrU8qxv1ccgUvgT2ZdhI8GrL_VDTytqhptJgm_IU",
}).then(() => console.log("Row added"));error: Uncaught (in promise) Error: Invalid response body while trying to fetch https://oauth2.googleapis.com/token: Premature close
at Gaxios._request (file:///home/uri/.cache/deno/npm/registry.npmjs.org/gaxios/7.1.1/build/cjs/src/gaxios.js:164:23)
at Object.runMicrotasks (ext:core/01_core.js:692:26)
at processTicksAndRejections (ext:deno_node/_next_tick.ts:59:10)
at runNextTicks (ext:deno_node/_next_tick.ts:76:3)
at eventLoopTick (ext:core/01_core.js:185:21)
Caused by: FetchError: Invalid response body while trying to fetch https://oauth2.googleapis.com/token: Premature close
at consumeBody (file:///home/uri/.cache/deno/npm/registry.npmjs.org/node-fetch/3.3.2/src/body.js:234:60)
at Object.runMicrotasks (ext:core/01_core.js:692:26)
at processTicksAndRejections (ext:deno_node/_next_tick.ts:59:10)
at runNextTicks (ext:deno_node/_next_tick.ts:76:3)
at eventLoopTick (ext:core/01_core.js:185:21)
at async Response.text (file:///home/uri/.cache/deno/npm/registry.npmjs.org/node-fetch/3.3.2/src/body.js:158:18)
at async Response.json (file:///home/uri/.cache/deno/npm/registry.npmjs.org/node-fetch/3.3.2/src/body.js:148:16)
at async Gaxios._defaultAdapter (file:///home/uri/.cache/deno/npm/registry.npmjs.org/gaxios/7.1.1/build/cjs/src/gaxios.js:117:22)
at async Gaxios._request (file:///home/uri/.cache/deno/npm/registry.npmjs.org/gaxios/7.1.1/build/cjs/src/gaxios.js:143:38)
A clear and concise description of what the bug is, and what you expected to happen.
for some reasno gaxios throws exception in deno not in node
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
is deno supported?
timothy-b
Metadata
Metadata
Assignees
Labels
No labels