Closed vallhallalm closed 5 months ago
Same bug here.
Same bug here
same bug here
For now, adding an override in package.json seems to be enough to solve the issue.
"overrides": { "@solana/spl-token": "0.3.5" }
spl-token library got updated in the last realease and it brings some broken references in.
Help me understand a bit more about what's going on here:
@solana/web3.js
doesn't have @solana/codecs-data-structures
in its dependency tree, so where is that coming from?Things I know:
As far as i managed to understand, @solana/codecs-data-structures
is a dependency of @solana/codecs
, which is
somehow a dependency of @solana/spl-token
, but only in version 0.4.5. Also, it doesn't bring in a stable version of @solana-codecs, but an unstable/preview one: @solana/codecs-data-structures
Additionally, the package got updated litterally 4 hours ago, so it might be fixed by now.
I tried typechecking with @solana/spl-token@0.4.6
and it works. I'm pretty sure this is just my mistake from yesterday, and you all were unlucky enough to install 0.4.4 or 0.4.5 in your apps. Sorry about that. Please upgrade to 0.4.6.
Also possible: The TypeScript feature (const type parameters) in the OP was introduced in TypeScript 5. If you're on 4 you should upgrade.
I am running into this same issue (0.4.6 of spl-token)
project:build: ../node_modules/.pnpm/@solana+codecs-data-structures@2.0.0-preview.2/node_modules/@solana/codecs-data-structures/dist/types/data-enum.d.ts(72,44): error TS1139: Type parameter declaration expected.
project:build: ../node_modules/.pnpm/@solana+codecs-data-structures@2.0.0-preview.2/node_modules/@solana/codecs-data-structures/dist/types/data-enum.d.ts(72,60): error TS1005: ',' expected.
project:build: ../node_modules/.pnpm/@solana+codecs-data-structures@2.0.0-preview.2/node_modules/@solana/codecs-data-structures/dist/types/data-enum.d.ts(72,76): error TS1005: ',' expected.
project:build: ../node_modules/.pnpm/@solana+codecs-data-structures@2.0.0-preview.2/node_modules/@solana/codecs-data-structures/dist/types/data-enum.d.ts(72,90): error TS1109: Expression expected.
project:build: ../node_modules/.pnpm/@solana+codecs-data-structures@2.0.0-preview.2/node_modules/@solana/codecs-data-structures/dist/types/data-enum.d.ts(72,100): error TS1005: ')' expected.
project:build: ../node_modules/.pnpm/@solana+codecs-data-structures@2.0.0-preview.2/node_modules/@solana/codecs-data-structures/dist/types/data-enum.d.ts(72,120): error TS1109: Expression expected.
project:build: ../node_modules/.pnpm/@solana+codecs-data-structures@2.0.0-preview.2/node_modules/@solana/codecs-data-structures/dist/types/data-enum.d.ts(72,156): error TS1005: ';' expected.
As far as i managed to understand, @solana/codecs-data-structures is a dependency of @solana/codecs, which is somehow a dependency of @solana/spl-token, but only in version 0.4.5. Also, it doesn't bring in a stable version of @solana-codecs, but an unstable/preview one: @solana/codecs-data-structures
The dependency resolution for me was to:
https://www.npmjs.com/package/@solana/codecs-data-structures/v/2.0.0-preview.2
Also possible: The TypeScript feature (const type parameters) in the OP was introduced in TypeScript 5. If you're on 4 you should upgrade.
what options do we have if we cannot upgrade to typescript 5?
You could consider patch-package
to codemod out the const keyword, but you should upgrade to TypeScript 5 if at all possible.
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.
Overview
Hi, While trying to reinstall the packages of my typescript application using npm v10.5.0 (node v20.12.1) I came across an issue that led me not to be able to build (using ./node_modules/typescript/bin/tsc). solana-web3.js has had a really recent release and it seems like the update of solana-web3.js create a cascade of dependencies update that leads me to the following kind of error:
Steps to reproduce
In a typescript app that contains "@solana/web3.js" as a dependencies in the package.json and which was not already updated after the recent release: delete node_modules folder, delete package-lock.json file, run npm i, run ./node_modules/typescript/bin/tsc
You should obtain the same kind of error as shown before.
Description of bug
When running ./node_modules/typescript/bin/tsc after installing back my node_modules I got the errors provided earlier. I expect not to get these errors just by installing back my packages
Thanks in advance for your help