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 with export type * from #2329

Closed
stefanprobst opened this issue Jun 17, 2022 · 2 comments
Closed

error with export type * from #2329

stefanprobst opened this issue Jun 17, 2022 · 2 comments

Comments

@stefanprobst
Copy link

echo "export type * from './types'" | npx esbuild --loader=ts

results in:

✘ [ERROR] Expected identifier but found "*"

    <stdin>:1:12:
      1 │ export type * from './types'
        ╵             ^

1 error
@evanw
Copy link
Owner

evanw commented Jun 17, 2022

That's not valid TypeScript. The TypeScript compiler says this:

example.ts:1:1 - error TS1383: Only named exports may use 'export type'.

1 export type * from './types'
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please check that your code is valid before assuming the problem is with esbuild. Closing this issue as invalid.

@stefanprobst
Copy link
Author

stefanprobst commented Jun 18, 2022

oh sorry! this was in generated code so i assumed it was valid. sorry for that, should have checked. the upstream issue for this seems to be microsoft/TypeScript#37238 / microsoft/TypeScript#48508 btw.

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

No branches or pull requests

2 participants