You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Observe error: "Cannot read properties of undefined (reading 'fields')"
Error is thrown from mergeSchemaWithRows_ function here. Most likely happens because this.metadata.schema is undefinedhere
Full stack trace
TypeError: Cannot read properties of undefined (reading 'fields')
at Function.mergeSchemaWithRows_ (node_modules/.pnpm/@google-cloud+bigquery@7.9.2/node_modules/@google-cloud/bigquery/build/src/bigquery.js:305:35)
at onComplete (node_modules/.pnpm/@google-cloud+bigquery@7.9.2/node_modules/@google-cloud/bigquery/build/src/table.js:972:32)
at node_modules/.pnpm/@google-cloud+bigquery@7.9.2/node_modules/@google-cloud/bigquery/build/src/table.js:1007:13
at node_modules/.pnpm/@google-cloud+common@5.0.2/node_modules/@google-cloud/common/build/src/util.js:412:25
at Util.handleResp (node_modules/.pnpm/@google-cloud+common@5.0.2/node_modules/@google-cloud/common/build/src/util.js:161:9)
at node_modules/.pnpm/@google-cloud+common@5.0.2/node_modules/@google-cloud/common/build/src/util.js:534:22
at onResponse (node_modules/.pnpm/retry-request@7.0.2/node_modules/retry-request/index.js:259:7)
at /Volumes/Dev/pasisalo/Projects/hox/node_modules/.pnpm/teeny-request@9.0.0/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.
@kirstu thanks for the report. The repro snippet that you wrote was a good one to repro the error, which actually happens when trying to call getRows on a empty table, which if I understood correctly, might not be what was intended on the snippet. It is missing setting the newly created table as a destination table for the query job. Because of that, the table being fetched is always empty.
Activity
alvarowolfx commentedon Apr 1, 2025
@kirstu thanks for the report. The repro snippet that you wrote was a good one to repro the error, which actually happens when trying to call
getRowson a empty table, which if I understood correctly, might not be what was intended on the snippet. It is missing setting the newly created table as a destination table for the query job. Because of that, the table being fetched is always empty.Updated snippet that I used:
The sample in https://cloud.google.com/bigquery/docs/paging-results#iterate_through_client_libraries_results is tested in our integration tests and are working fine, I also ran it manually to double check.
Sent a PR to solve the issue with empty table: #1455