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

ESBuild cannot handle ES decorator with typed parameter #3308

Closed
ocavue opened this issue Aug 11, 2023 · 0 comments
Closed

ESBuild cannot handle ES decorator with typed parameter #3308

ocavue opened this issue Aug 11, 2023 · 0 comments

Comments

@ocavue
Copy link

ocavue commented Aug 11, 2023

ESBuild cannot handle the TypeScript syntax like @log<string>("foo").

Steps to reproduce:

  1. Clone https://github.com/issueset/esbuild-19-0-decorator and install dependencies via pnpm install. This repo contains two TypeScript files entry1.ts and entry2.ts.
  2. Run pnpm run build:tsc. tsc outputs the JavaScript files under dist/ without any issue.
  3. Run pnpm run build:esbuild:1. ESBuild can handle entry1.ts
  4. Run pnpm run build:esbuild:2. ESBuild throws this error: [ERROR] Expected "class" after decorator but found "<"

You can also see the error message through the following link:

https://esbuild.github.io/try/#YgAwLjE5LjAAAGUAZW50cnkyLnRzAGZ1bmN0aW9uIGxvZzxUPihvcHRpb25zOiBUKSB7CiAgY29uc3QgZGVjb3JhdG9yID0gKGNsczogYW55LCBjb250ZXh0OiBDbGFzc0RlY29yYXRvckNvbnRleHQpID0+IHsKICAgIHJldHVybiBjbHM7CiAgfTsKICByZXR1cm4gZGVjb3JhdG9yOwp9CgpAbG9nPHN0cmluZz4oImZvbyIpCmV4cG9ydCBjbGFzcyBNeUNsYXNzIHt9

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

1 participant