Я сгенерировал базовое приложение, используя create-react-app
, и в приложении установил модуль @google-cloud/bigquery
с npm install --save @google-cloud/bigquery
. Я попытался просто импортировать модуль, добавив import * as BigQuery from '@google-cloud/bigquery';
в файл src/App.js
, и при открытии веб-страницы он отображает следующие ошибки:
Uncaught TypeError: Cannot convert undefined or null to object
at Function.getPrototypeOf (<anonymous>)
at ./node_modules/google-auth-library/node_modules/pify/index.js.module.exports (index.js:75)
at Object../node_modules/google-auth-library/node_modules/gtoken/build/src/index.js (index.js:54)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../node_modules/google-auth-library/build/src/auth/jwtclient.js (jwtclient.js:63)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object.<anonymous> (googleauth.js:73)
at Object../node_modules/google-auth-library/build/src/auth/googleauth.js (googleauth.js:815)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../node_modules/google-auth-library/build/src/index.js (index.js:18)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object.<anonymous> (index.js:6)
at Object../node_modules/google-auto-auth/index.js (index.js:377)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../node_modules/@google-cloud/common/src/util.js (util.js:27)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../node_modules/@google-cloud/common/src/service-object.js (service-object.js:32)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../node_modules/@google-cloud/common/src/operation.js (operation.js:31)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../node_modules/@google-cloud/common/src/index.js (index.js:27)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object.<anonymous> (index.js:20)
at Object../node_modules/@google-cloud/bigquery/src/index.js (index.js:1448)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../src/App.js (App.css?9a66:26)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object../src/index.js (index.css?f255:26)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at fn (bootstrap b9222e6f9a2beb020d02:88)
at Object.1 (lib crypto:1)
at __webpack_require__ (bootstrap b9222e6f9a2beb020d02:678)
at ./node_modules/@google-cloud/bigquery/package.json.module.exports._from (bootstrap b9222e6f9a2beb020d02:724)
at bootstrap b9222e6f9a2beb020d02:724
Я пока мало знаю о работе узлов и React, так что извините, если этот вопрос некорректен. Я хотел бы использовать это для извлечения данных из BigQuery и отображения их в моем веб-приложении, но слепое следование инструкциям по использованию этого модуля не работает здесь или на другом компьютере, как я пытался сделать.