Closed ctrlc03 closed 1 month ago
Which version of viem and perissionless are you using? Also can you share the tsconfig?
Which version of viem and perissionless are you using? Also can you share the tsconfig?
Hey thanks for the reply.
viem: 2.16.3 permissionless: 0.1.44
Tsconfig:
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
Can you try the following adjustments:
"module": "NodeNext",
"target": "ES2021", // Setting this to `ES2021` enables native support for `Node v16+`: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping.
"lib": [
"ES2022", // By using ES2022 we get access to the `.cause` property on `Error` instances.
"DOM" // We are adding `DOM` here to get the `fetch`, etc. types. This should be removed once these types are available via DefinitelyTyped.
],
I think this is a good resource on how to map based on your node version - https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
Can you try the following adjustments:
"module": "NodeNext", "target": "ES2021", // Setting this to `ES2021` enables native support for `Node v16+`: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping. "lib": [ "ES2022", // By using ES2022 we get access to the `.cause` property on `Error` instances. "DOM" // We are adding `DOM` here to get the `fetch`, etc. types. This should be removed once these types are available via DefinitelyTyped. ],
Thanks! no chance that can be fixed? I would rather not go down this route of using esm if possible.
Hey so cause was introduced in ES2022, for a detailed Explanation you can checkout here - https://stackoverflow.com/a/73394582
I understand these versions can be frustrating I hope this will help you a little.
Hey so cause was introduced in ES2022, for a detailed Explanation you can checkout here - https://stackoverflow.com/a/73394582
I understand these versions can be frustrating I hope this will help you a little.
gotcha, will amend on my side, appreciate your help with this! 🙏 I'll close the issue
Currently, I am unable to use libraries built on top of permissionless.js like @zerodev/sdk due to this error present at https://github.com/pimlicolabs/permissionless.js/blob/main/packages/permissionless/errors/estimateUserOperationGas.ts#L13 and https://github.com/pimlicolabs/permissionless.js/blob/main/packages/permissionless/errors/sendUserOperation.ts#L13
Looks like an easy fix would be removing the
override
keyword