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 after next js build #2798

Closed
afu-hive opened this issue Jan 6, 2023 · 4 comments
Closed

typescript error after next js build #2798

afu-hive opened this issue Jan 6, 2023 · 4 comments

Comments

@afu-hive
Copy link

afu-hive commented Jan 6, 2023

Here error

image

I got this error after implement test feature with vitest

here my dependency version

"react": "17.0.1",
"@types/react": "17.0.2",
"typescript": "4.1.2",
"vitest": "^0.26.3"
"@vitejs/plugin-react": "^3.0.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"enzyme": "^3.11.0",

I try to remove get text(): string; line it's work fine but when I build on CI node_modules will recreate and this error happen again

@evanw
Copy link
Owner

evanw commented Jan 6, 2023

That error is not from esbuild. You have the wrong project.

@evanw evanw closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2023
@evanw
Copy link
Owner

evanw commented Jan 6, 2023

Wait sorry, I missed that it was from esbuild’s type definitions. I’ll take a look.

@evanw evanw reopened this Jan 6, 2023
@evanw
Copy link
Owner

evanw commented Jan 7, 2023

It looks like you need to upgrade to TypeScript 4.3+.

@evanw
Copy link
Owner

evanw commented Jan 7, 2023

This type syntax seems to be the only thing that prevents these type declarations from being used in older TypeScript versions. So I can just remove this type syntax. That'll let the type declarations be used as far back as TypeScript 3.5. (before that version TypeScript doesn't include type declarations for the WebAssembly global variable). I'll also add a test to ensure that this doesn't accidentally regress in the future.

@evanw evanw closed this as completed in b3b06c7 Jan 7, 2023
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