Closed
Description
Describe your environment
- Operating System version: mac osx
- Firebase SDK version: 12.1.0
- Firebase Product: gcm/push
- Node.js version: 20.11
- PNPM version: 8
Steps to reproduce:
When using firebase sdk in an ES6 environment where the tsconfig looks like:
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"removeComments": true,
"esModuleInterop": true,
"noEmitOnError": false,
"sourceMap": true,
"inlineSources": true,
"sourceRoot": "/",
"declaration": true,
"noEmitHelpers": true,
"importHelpers": true
}
}
and the package.json is set to type: "module"
you get the following error with the long module:
../../node_modules/.pnpm/[email protected]/node_modules/long/umd/index.d.ts:1:18 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead.
Relevant Code:
I believe the issue may be this line
but I am not totally sure.