When isolatedModules is set to true in my tsconfig, I get the following error when trying to import something:
import { Program } from "@project-serum/anchor";
import * as anchor from "@project-serum/anchor";
import * as anchor_types from "@project-serum/anchor/src/program/namespace/types";
Can't import from anchor or we get this error when compiling from the frontend:
/.../node_modules/@project-serum/anchor/src/index.ts
TypeScript error in /.../node_modules/@project-serum/anchor/src/index.ts(15,10):
Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'. TS1205
13 |
14 | export * from "./error.js";
> 15 | export { Instruction } from "./coder/instruction.js";
| ^
16 | export { Idl } from "./idl.js";
17 |
18 | export * as utils from "./utils/index.js";
When
isolatedModules
is set to true in my tsconfig, I get the following error when trying to import something: