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

Errors with function named readonly #213

Closed
m4rvr opened this issue Jul 2, 2020 · 2 comments
Closed

Errors with function named readonly #213

m4rvr opened this issue Jul 2, 2020 · 2 comments

Comments

@m4rvr
Copy link

m4rvr commented Jul 2, 2020

Hey!

I'm using Vite with Vue 3. Vue exports a function named readonly which returns a wrapped Readonly type. Using it as a return-type with ReturnType<typeof readonly> throws an error Unexpected ">".

I think the problem here is the reserved readonly keyword in interfaces for example because it works when I rename it in the import (import { readonly as readOnly } from 'vue').

Is this a problem with esbuild or maybe a bug in Vite itself?

@evanw
Copy link
Owner

evanw commented Jul 2, 2020

Thanks for reporting this. It's definitely a bug with esbuild. The problem is that for typeof readonly, the readonly identifier is incorrectly treated as a type operator. I'll fix this shortly.

@evanw evanw closed this as completed in 2692cab Jul 2, 2020
@evanw
Copy link
Owner

evanw commented Jul 2, 2020

This should be fixed in version 0.5.19.

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