Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error TS1383: Only named exports may use 'export type' #18

Closed
cloudatlas9 opened this issue Nov 9, 2023 · 4 comments · Fixed by #19
Closed

error TS1383: Only named exports may use 'export type' #18

cloudatlas9 opened this issue Nov 9, 2023 · 4 comments · Fixed by #19

Comments

@cloudatlas9
Copy link

After installing the assemblyai npm package, I get a bunch of these errors when trying to build the project:

> build
> tsc

node_modules/assemblyai/dist/index.d.ts:1:1 - error TS1383: Only named exports may use 'export type'.
1 export type * from "./types";

node_modules/assemblyai/dist/types/index.d.ts:1:1 - error TS1383: Only named exports may use 'export type'.
1 export type * from "./files";

node_modules/assemblyai/dist/types/index.d.ts:2:1 - error TS1383: Only named exports may use 'export type'.
2 export type * from "./transcripts";

node_modules/assemblyai/dist/types/index.d.ts:3:1 - error TS1383: Only named exports may use 'export type'.
3 export type * from "./realtime";

node_modules/assemblyai/dist/types/index.d.ts:4:1 - error TS1383: Only named exports may use 'export type'.
4 export type * from "./services";

node_modules/assemblyai/dist/types/index.d.ts:5:1 - error TS1383: Only named exports may use 'export type'.
5 export type * from "./asyncapi.generated";

node_modules/assemblyai/dist/types/index.d.ts:6:1 - error TS1383: Only named exports may use 'export type'.
6 export type * from "./openapi.generated";

node_modules/assemblyai/dist/types/services/index.d.ts:5:1 - error TS1383: Only named exports may use 'export type'.
5 export type * from "./abstractions";

Is it something on my side, configuration-wise?

P.S. And thanks for this super easy to use library (e.g. all type interfaces exported) ✌️

@Swimburger
Copy link
Contributor

@cloudatlas9 what version of TypeScript are you using? Can you run tsc --version?
Can you share your tsconfig?

@cloudatlas9
Copy link
Author

It's version 4.9.0, and this is the tsconfig I'm using:

{
  "compilerOptions": {
    "module": "commonjs",
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "outDir": "lib",
    "sourceMap": true,
    "strict": true,
    "target": "es2017",
    "resolveJsonModule": true,
    "esModuleInterop": true
  },
  "compileOnSave": true,
  "include": ["src"]
}

@Swimburger
Copy link
Contributor

I think the syntax we're using in the Node SDK is fine with newer versions of TypeScript, however, there's no harm in changing the syntax for us, so I'll change it up in a future release so this won't be an issue anymore.
For now, can you use a newer version of TypeScript?

@Swimburger
Copy link
Contributor

In version 3.1.0, we're using the export * ... syntax instead of export type * ... syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants