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".
This is provably a client error as it happens only post version 7.9.2
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/kirstu/2d343883f04c7f29fc8f065b9f6928e1
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
- Follow steps in https://cloud.google.com/bigquery/docs/paging-results#iterate_through_client_libraries_results
- Observe error: "Cannot read properties of undefined (reading 'fields')"
Error is thrown from mergeSchemaWithRows_
function here. Most likely happens because this.metadata.schema
is undefined
here
Full stack trace
TypeError: Cannot read properties of undefined (reading 'fields')
at Function.mergeSchemaWithRows_ (node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/bigquery/build/src/bigquery.js:305:35)
at onComplete (node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/bigquery/build/src/table.js:972:32)
at node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/bigquery/build/src/table.js:1007:13
at node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/common/build/src/util.js:412:25
at Util.handleResp (node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/common/build/src/util.js:161:9)
at node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/common/build/src/util.js:534:22
at onResponse (node_modules/.pnpm/[email protected]/node_modules/retry-request/index.js:259:7)
at /Volumes/Dev/pasisalo/Projects/hox/node_modules/.pnpm/[email protected]/node_modules/teeny-request/src/index.ts:320:13
A clear and concise description of what the bug is, and what you expected to happen.
table.getRows
should return a response, instead an error is thrown
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. **
The change introduced in release 7.9.2
is causing the issue. Version prior to 7.9.2
work just as expected. From the linked commit it's pretty obvious why the error happens.