You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on typechain 8.1.0 and @typechain/ethers-v5 10.1.0, and since I see other imports using "import type", maybe something changed in ethers library, where "Overrides" became a type? I'm currently on ethers version 5.6.8.
Update: It appears that only "Factory" generated files suffer from the issue, so it makes me think something could've been accidentally left out / forgotten in #636 refactoring.
I inspected some other files and also "BigNumberish" is sometimes included without the "type" specification. Otherwise the other generated files look fine.
tfalencar
changed the title
Support for TypeChain with Sveltekit
Support for TypeChain with Sveltekit, ethers 5.6.8
Jun 24, 2022
tfalencar
changed the title
Support for TypeChain with Sveltekit, ethers 5.6.8
Missing 'type' in some imports, causing issues with Sveltekit compiler configuration
Jun 24, 2022
When trying to use the generated code for contract factories, in combination with SvelteKit, the following error appears:
'Overrides' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled. ts(1444).
On the following line (of a Dummy__factory.ts file):
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
Which can be solved by adding "type" to "Overrides":
import { Signer, utils, Contract, ContractFactory, type Overrides } from "ethers";
The default configuration in SvelteKit indeed activates both isolatedModules and preserveValueImports in its tsconfig.json "compilerOptions", see: https://kit.svelte.dev/docs/types#generated-types-default-tsconfig-json
If there is no impact/downsides to using type-only import, implementing the suggestion above would make the experience better for Svelte-kit projects.
The text was updated successfully, but these errors were encountered: