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

[Bug]: TypeScript private fields do not work when target is es5 #8537

Closed
cascornelissen opened this issue Jun 20, 2022 · 3 comments
Closed
Labels

Comments

@cascornelissen
Copy link

Bug description

Steps to reproduce the problem:

  1. Set target to es5 in tsconfig.json
  2. Run something like tsc --declaration --emitDeclarationOnly

This works on 14.3.0 but breaks on 14.4.0, the relevant changes were made in #8506. I couldn't really find anything related to whether it's ok that this broke according to the guidelines but it was unexpected to use, which is why I'm creating this issue.

Puppeteer version

14.4.0

Node.js version

v16.13.1

npm version

8.9.0

What operating system are you seeing the problem on?

macOS

Relevant log output

node_modules/puppeteer/lib/types.d.ts:6999:14 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

6999              #private;
                  ~~~~~~~~
@jrandolf
Copy link
Contributor

Is there a reason you need to use es5?

@cascornelissen
Copy link
Author

It pains me to say it out loud but we still support Internet Explorer (for a few more weeks). Puppeteer doesn't have anything to do with the fact that we're still supporting this ancient browser, I just created this issue because it was kind of unexpected that our builds started failing with this new minor version of puppeteer.

I'm ok with not fixing this on puppeteer's side by the way, just wanted to make clear that this is happening to us and probably to others as well.

@jrandolf
Copy link
Contributor

I see. I'd recommend somehow separating the testing infrastructure from your builds. Puppeteer is in no way related to IE, so it'd be best to keep these separate build-wise.

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

No branches or pull requests

2 participants