Open PhilippeR26 opened 6 months ago
The issue is that your bundle project is CommonJS so you can switch to new es-module or you can use type import:
import type { SomeWalletApiType } from '@starknet-io/types-js'
maybe you will need to use "moduleResolution": "Bundler" if you stay on Commonjs.
This is not strictly a ts-types issue but I can do an example on your project if you still have this issue? so that others can copy the solution.
A script that handles the problem : https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/main/src/scripts/Starknet131/Starknet131-sepolia/2.testZeroable.ts
Link is deprecated, can we close this one ?
Unfortunately the problem is still there : https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/main/src/scripts/Starknet131/Starknet131-devnet/10.testZeroable.ts
Yea because ts-node is fixating on type and not resolving exports. https://github.com/TypeStrong/ts-node/issues/935#issuecomment-1872164284 https://stackoverflow.com/questions/63742790/unable-to-import-esm-ts-module-in-node/74608156#74608156 This setup works without any issue with tsx.
Anyway, I can propose this solution at the moment check if it's working for you: https://github.com/starknet-io/types-js/pull/23
Build released on alpha channel: https://www.npmjs.com/package/@starknet-io/types-js/v/0.7.8-alpha.1 npm i @starknet-io/types-js@0.7.8-alpha.1
Describe the bug When using this lib in ts-node, I have a compilation message error :
To Reproduce
Expected behavior Use of this library with my project config, without compilation error.
Screenshots N/A
Desktop (please complete the following information):
Additional context I am using this project config for a long time, without any problem on many libraries, except this one.