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

Babel error when using override of TypeScript 4.3.2 #27124

Closed
Lonest90 opened this issue Jul 12, 2021 · 5 comments · Fixed by #28174
Closed

Babel error when using override of TypeScript 4.3.2 #27124

Lonest90 opened this issue Jul 12, 2021 · 5 comments · Fixed by #28174
Labels
bug Issue was opened via the bug report template.

Comments

@Lonest90
Copy link

Lonest90 commented Jul 12, 2021

What version of Next.js are you using?

11.0.1

What version of Node.js are you using?

14.16.0

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying your application?

next dev

Describe the Bug

I noticed that the basic-feature of docs has the wrong information as it says:

It is highly recommended to be on at least v4.3.2 of TypeScript to experience the best performance when leveraging this feature.

But Next.JS still doesn't support some features of the version because of the Babel version 7.12.5, and what's new in TypeScript 4.3 is only added in version 7.14.0 as per the update notes

Uncaught at getBabelError

image

Expected Behavior

update the Babel dependency of Next.JS to version 7.14.0, or remove the Incremental type checking from the docs telling to use a TypeScript version that Next.JS is not yet supported.

To Reproduce

an example error is using the new TypeScript override:

class Test {
  show () {
    console.log('show Test')
  }
}

class Test2 extends Test {
  override show(){
    console.log('overriding show Test')
  }
}

new Test2().show()
@Lonest90 Lonest90 added the bug Issue was opened via the bug report template. label Jul 12, 2021
@cakoose
Copy link

cakoose commented Jul 19, 2021

I ran into this as well. Is there a way to set the Babel dependency version in package.json (I'm using yarn) to make this work?

@feRpicoral
Copy link

I'm having the same issue. Tried installing @babel/preset-typescript separately but it didn't work as well.

@ijjk
Copy link
Member

ijjk commented Aug 17, 2021

Hi, this should be fixed in the latest canary of Next.js v11.1.1-canary.10, please update and give it a try!

@Lonest90
Copy link
Author

Hi @ijjk, I tested it and it's working, thanks.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants