Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error TS2315: Type 'Int32Array' is not generic. #1664

Open
pixelsnis opened this issue Jan 20, 2025 · 14 comments
Open

Error TS2315: Type 'Int32Array' is not generic. #1664

pixelsnis opened this issue Jan 20, 2025 · 14 comments

Comments

@pixelsnis
Copy link

Related issues

None that I could find

[REQUIRED] Version info

"firebase-admin": "^12.1.0"
"firebase-functions": "^5.0.0"

node:

v20.16.0

firebase-functions:

12.1.0

firebase-tools:

13.16.0

firebase-admin:

12.1.0

[REQUIRED] Test case

Initialize Firebase functions using firebase init functions. Write any function and try deploying with firebase deploy --only functions.

[REQUIRED] Steps to reproduce

Same as test case

[REQUIRED] Expected behavior

Deployment should go through normally

[REQUIRED] Actual behavior

Deployment fails with this error:

node_modules/@google-cloud/storage/build/cjs/src/crc32c.d.ts:115:45 - error TS2315: Type 'Int32Array' is not generic.

Were you able to successfully deploy your functions?

No, but by modifying the mentioned file manually and changing Int32Array<ArrayBuffer> to Int32Array fixes it temporarily. Function deploys after that.

@google-oss-bot
Copy link
Collaborator

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@nickgiarraputo
Copy link

This is a new problem for sure. Just initialized a new firebase project and it won't even build with it's own default code.

@nickgiarraputo
Copy link

nickgiarraputo commented Jan 20, 2025

Want to also add that your fix does work for me as well. Reverting Int32Array<ArrayBuffer> to simply Int32Array. I'm not sure why this was changed.

@tdcolvin
Copy link

Same issue using:
"firebase-admin": "^13.0.2",
"firebase-functions": "^6.2.0"
... and node 22.13.0

@tdcolvin
Copy link

The problem seems to be an outdated version of Typescript which is installed by default in the project created using firebase init. For me it installed Typescript 4.9.0.
Running npm i typescript@latest upgraded it to v5.7.3 and that seemed to solve the issue.

@jimmy-chiang
Copy link

Encounter this issue too.
I can confirm that @tdcolvin solution can solve this error.

@fransiska
Copy link

"firebase-admin": "^13.0.2",
"firebase-functions": "^6.2.0",
"typescript": "^5.7.3"
... and node 20.18.1

still has the same error, only solved by changing the source file manually

@Padreco-lbr
Copy link

Can confirm that upgrading typescript solved the issue for me as well, as per @tdcolvin.

@imanabu
Copy link

imanabu commented Jan 22, 2025

Confirmed: Upgrade TypeScript to 5.7.3 will fix this issue.

yarn add -D typescript@latest

@ItsTeccs
Copy link

Built fine yesterday, had issues today. Can confirm as well that updating TypeScript to latest fixed the issue immediately.

@imanabu
Copy link

imanabu commented Jan 26, 2025

Also, this message should be updated if TS 5.7.3 is indeed required.

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.5.0

YOUR TYPESCRIPT VERSION: 5.7.3

@SamJbori
Copy link

Same issue

 "dependencies": {
    "firebase-admin": "^13.0.2",
    "firebase-functions": "^6.3.0",
  },
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^5.62.0",
    "@typescript-eslint/parser": "^5.62.0",
    "eslint": "^8.57.1",
    "eslint-config-google": "^0.14.0",
    "eslint-plugin-import": "^2.31.0",
    "firebase-functions-test": "^3.4.0",
    "typescript": "^5.5.4"
  },

@tdcolvin
Copy link

Also, this message should be updated if TS 5.7.3 is indeed required.

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.5.0

YOUR TYPESCRIPT VERSION: 5.7.3

I don't know if this message is caused by out-of-date firebase-tools running the build, or out-of-date firebase-admin / firebase-functions dependencies used during the build. But my experience is that by upgrading all three of these, the message no longer appears.

@kkig
Copy link

kkig commented Feb 3, 2025

"@google-cloud/storage": "^7.15.0"
"firebase-admin": "^13.0.2"
"firebase-functions": "^6.3.1"
"typescript": "^4.9.0"

node_modules/@google-cloud/storage/build/cjs/src/crc32c.d.ts:6:39 - error TS2315: Type 'Int32Array' is not generic.
declare const CRC32C_EXTENSION_TABLE: Int32Array<ArrayBuffer>;
                                        ~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@google-cloud/storage/build/cjs/src/crc32c.d.ts:115:45 - error TS2315: Type 'Int32Array' is not generic.
static readonly CRC32C_EXTENSION_TABLE: Int32Array<ArrayBuffer>;

Updating typescript to 5.7.3 fixed this issue. Can confirm @tdcolvin solution works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests