Skip to content

error with export type * from #2329

Closed
Closed
@stefanprobst

Description

@stefanprobst
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

Activity

evanw

evanw commented on Jun 17, 2022

@evanw
Owner

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

stefanprobst commented on Jun 18, 2022

@stefanprobst
Author

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @evanw@stefanprobst

        Issue actions

          error with `export type * from` · Issue #2329 · evanw/esbuild