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.

Cannot 'export default' abstract, ambient class or interface

See original GitHub issue
export default abstract class B {

}

By the way, the same with

export default declare class B {

}

Seems to be a parser bug

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:35
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

75reactions
danquirkcommented, Jul 9, 2015

We should just allow these. It’s a strange inconsistency, the workaround is more verbose, and the error gives you no help getting to the workaround.

38reactions
mhegazycommented, Oct 6, 2017

Unsupported export default patterns:

  • export default abstract class C { } Added by #14657
  • export default declare class C { }
  • export default interface I { } Added by #16040
  • export default enum E { }
  • export default const enum E { }
  • export default namespace N { }
  • export default type T = { }
Read more comments on GitHub >

github_iconTop Results From Across the Web

export removes interface implementation from class in typeScript
When I put your code on a typescript playground I get this error: class A Merged declaration 'A' cannot include a default export...
Read more >
TypeScript errors and how to fix them
When you are importing a module with built-in TypeScript declarations and TypeScript tells you that this module does not have a default export,...
Read more >
Abstract Methods and Classes (The Java™ Tutorials ...
Abstract classes are similar to interfaces. You cannot instantiate them, and they may contain a mix of methods declared with or without an...
Read more >
Documentation - TypeScript 2.0
In strict null checking mode the compiler requires every reference to a local variable of a type that doesn't include undefined to be...
Read more >
typescript-cheatsheet - GitHub Pages
Export; Default Exports; Import; Advanced Module Loading ... Unlike an interface, an abstract class may contain implementation details for its members.
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