question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Babel error when using override of TypeScript 4.3.2

See original GitHub issue

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()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Lonest90commented, Aug 17, 2021

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

0reactions
balazsorban44commented, Jan 27, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - TypeScript 4.3
When this option is turned on, it becomes an error to override any method from a superclass unless you explicitly use an override...
Read more >
7.14.0 Released: New class features enabled by default ...
Babel 7.14.0 is out! This release enables class fields and private methods by default (they were promoted to Stage 4 during the recent...
Read more >
Namespace not marked type-only declare - Babel/Typescript
I used the packages react-app-rewired with the cutomize-cra. I created the config-overrides.js to overrides the config about cra (create-react- ...
Read more >
@babel/preset-typescript | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Javascript – Namespace not marked type-only declare – Babel ...
I have created app via npx create-react-app –typescript. And I wanted to use some autogenerated code with namespaces due to that babel throw...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found