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

TypeScript error when using with Vitest + Next.js and "skipLibCheck": false #19

Closed
elliottsj opened this issue Sep 28, 2022 · 1 comment · Fixed by #20
Closed

TypeScript error when using with Vitest + Next.js and "skipLibCheck": false #19

elliottsj opened this issue Sep 28, 2022 · 1 comment · Fixed by #20

Comments

@elliottsj
Copy link

Next.js uses "target": "es5" due to reasons described here.

So next build fails due to a type error when tinybench is present via Vitest:

../../node_modules/.pnpm/[email protected]/node_modules/tinybench/dist/index.d.ts:254:5
Type error: Private identifiers are only available when targeting ECMAScript 2015 and higher.

  252 |  */
  253 | declare class Bench extends EventTarget {
> 254 |     #private;
      |     ^
  255 |     signal?: AbortSignal;
  256 |     warmupTime: number;
  257 |     warmupIterations: number;

I have "skipLibCheck": false, so setting "skipLibCheck": true would be a workaround, but I'd lose type safety.

@Aslemammad
Copy link
Member

Thanks for the notice! It should work now.

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

Successfully merging a pull request may close this issue.

2 participants