diff --git a/packages/firestore/src/platform/node/grpc_connection.ts b/packages/firestore/src/platform/node/grpc_connection.ts index c217ec16658..e5a25eb2224 100644 --- a/packages/firestore/src/platform/node/grpc_connection.ts +++ b/packages/firestore/src/platform/node/grpc_connection.ts @@ -15,13 +15,14 @@ * limitations under the License. */ +import module from 'module'; + import { Metadata, GrpcObject, credentials as GrpcCredentials, ServiceError } from '@grpc/grpc-js'; -import { version as grpcVersion } from '@grpc/grpc-js/package.json'; import { Token } from '../../api/credentials'; import { DatabaseInfo } from '../../core/database_info'; @@ -35,6 +36,11 @@ import { logError, logDebug, logWarn } from '../../util/log'; import { NodeCallback, nodePromise } from '../../util/node_api'; import { Deferred } from '../../util/promise'; +const require = module.createRequire(import.meta.url); + +// eslint-disable-next-line @typescript-eslint/no-require-imports +const { version: grpcVersion } = require('@grpc/grpc-js/package.json'); + const LOG_TAG = 'Connection'; const X_GOOG_API_CLIENT_VALUE = `gl-node/${process.versions.node} fire/${SDK_VERSION} grpc/${grpcVersion}`; diff --git a/packages/firestore/tsconfig.json b/packages/firestore/tsconfig.json index f9c40e4eff2..4ea47b6b3ce 100644 --- a/packages/firestore/tsconfig.json +++ b/packages/firestore/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "../../config/tsconfig.base.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "allowSyntheticDefaultImports": true, + "module": "es2020" }, "exclude": [ "scripts/**/*",