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.

Angular issue while extending a subject class in Angular 10 in production mode

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package "@angular/animations": "~10.0.5",
"@angular/common": "~10.0.5",
"@angular/compiler": "~10.0.5",
"@angular/core": "~10.0.5",
"@angular/forms": "~10.0.5",
"@angular/platform-browser": "~10.0.5",
"@angular/platform-browser-dynamic": "~10.0.5",
"@angular/router": "~10.0.5",

Is this a regression?

Yes, the previous version(Angular 9) in which this bug was not present and this issue did not exist in Angular 11 also.

This issue only exists in Angular 10 only

Description

we have a subject class in our project: β€œexport class OrdersService extends Subject <DataSource_1>”

while extending that subject class in Angular 10 in Production mode.

We have been getting null value while extending and the following error:

β€œUncaught TypeError: Class extends value undefined is not a constructor or null”.

πŸ”¬ Minimal Reproduction

This issue occurred due to extends the β€œSubject” class in Angular 10 in production mode.

β€œexport class OrdersService extends Subject <DataSource_1>”

πŸ”₯ Exception or Error




**"Uncaught TypeError: Class extends value undefined is not a constructor or null".**



🌍 Your Environment

Angular Version:




"@angular/animations": "~10.0.5",
    "@angular/common": "~10.0.5",
    "@angular/compiler": "~10.0.5",
    "@angular/core": "~10.0.5",
    "@angular/forms": "~10.0.5",
    "@angular/platform-browser": "~10.0.5",
    "@angular/platform-browser-dynamic": "~10.0.5",
    "@angular/router": "~10.0.5",

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mlc-mlapiscommented, Feb 16, 2021

@praveenkumargspr As in many other cases, here, without a simple reproduction demo, it’s unrealistic that anybody can help with it. And the simple means really simple = with minimal dependencies, with code reduced only to the minimum of lines to make it as readable as possible.

1reaction
petebacondarwincommented, Feb 16, 2021

Please can you provide a reproduction of this problem that we can view?

Read more comments on GitHub >

github_iconTop Results From Across the Web

rxjs - o.Subject is not a constructor - Angular 10 - Stack Overflow
I think you need to check the import statements for Subject . It must be imported like import { Subject } from "rxjs/Subject";...
Read more >
Content projection - Angular
Components that use conditional content projection render content only when specific conditions are met. Single-slot content projectionlink. The most basic formΒ ...
Read more >
48 answers on StackOverflow to the most popular Angular ...
An observable can be created from both Subject and BehaviorSubject using subject.asobservable() . Only difference being you can't send values toΒ ...
Read more >
Using an NgRX Store Module in an Angular Application
This works fine for small applications. In some cases, as the application grows in size and multiple components start issuing calls to update...
Read more >
Angular 5 Tutorial: Guide to Your First Angular 5 App - Toptal
But that may be a problem, too. Angular is a fully integrated framework that allows you to start working on your project quickly...
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