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.

v9.0.6 -> Uncaught TypeError: Cannot read property 'type' of undefined

See original GitHub issue

🐞 bug report

Updated to 9.0.6 and we got the error: Uncaught TypeError: Cannot read property ‘type’ of undefined

Is this a regression?

with 9.0.5 no problem.

🔥 Exception or Error


Uncaught TypeError: Cannot read property 'type' of undefined
    at Module.ɵɵNgOnChangesFeature (:4200/vendor.js:44937)
    at Module../node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js (:4200/vendor.js:14192)
    at __webpack_require__ (:4200/runtime.js:85)
    at Module../node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js (:4200/vendor.js:17244)
    at __webpack_require__ (:4200/runtime.js:85)
    at Module../node_modules/@aulos/core/fesm2015/aulos-core.js (:4200/vendor.js:89726)
    at __webpack_require__ (:4200/runtime.js:85)
    at Module.<anonymous> (:4200/main.js:2232)
    at Module../src/main.ts (:4200/main.js:2273)
    at __webpack_require__ (:4200/runtime.js:85)

🌍 Your Environment

Angular Version:



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.0.5
Node: 12.15.0
OS: win32 x64

Angular: 9.0.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.5
@angular-devkit/build-angular     0.900.5
@angular-devkit/build-optimizer   0.900.5
@angular-devkit/build-webpack     0.900.5
@angular-devkit/core              9.0.5
@angular-devkit/schematics        9.0.5
@angular/cdk                      9.1.2
@angular/cli                      9.0.5
@ngtools/webpack                  9.0.5
@schematics/angular               9.0.5
@schematics/update                0.900.5
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Seems to be related to https://github.com/angular/angular/pull/35846/ Actually we found a call to the function:

function ɵɵNgOnChangesFeature(definition) {
    if (definition.type.prototype.ngOnChanges) {
        definition.setInput = ngOnChangesSetInput;
        ((/** @type {?} */ (definition))).onChanges = wrapOnChanges();
    }
}

without any param here (see last property features ):

NgComponentOutlet.ɵdir = ɵngcc0.ɵɵdefineDirective({ type: NgComponentOutlet, selectors: [["", "ngComponentOutlet", ""]], inputs: { ngComponentOutlet: "ngComponentOutlet", ngComponentOutletInjector: "ngComponentOutletInjector", ngComponentOutletContent: "ngComponentOutletContent", ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory" }, features: [ɵngcc0.ɵɵNgOnChangesFeature()] });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
meriturvacommented, Mar 11, 2020

@sahlifiras26 you are simply using a library not well packed or you have to build correctly yours. @ericmartinezr would you be so kind as to help us with a little advice?

2reactions
sahlifiras26commented, Mar 11, 2020

Hello, i’m facing the same problem but i got this log :

Uncaught TypeError: Cannot read property ‘type’ of undefined at Il (main-es2015.758ef42104c26b069343.js:1) at main-es2015.758ef42104c26b069343.js:1 at Module.zUnb (main-es2015.758ef42104c26b069343.js:1) at l (runtime-es2015.0811dcefd377500b5b1a.js:1) at Object.0 (main-es2015.758ef42104c26b069343.js:1) at l (runtime-es2015.0811dcefd377500b5b1a.js:1) at t (runtime-es2015.0811dcefd377500b5b1a.js:1) at Array.r [as push] (runtime-es2015.0811dcefd377500b5b1a.js:1) at main-es2015.758ef42104c26b069343.js:1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'type' of undefined Angular 9
You have an error in your javascript. some variable is undefined. somewhere you are doing undefined.type or undefined.type() . – Get Off My...
Read more >
Cannot Read Property 'Type' Of Undefined Angular 9 - ADocLib
I'm getting the error "Uncaught TypeError: Cannot read property 'sort' of undefined" in the Dev Console when trying to access the Contacts. Electron:...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Cannot read property 'type' of undefined - #sentry
Hi,. I've just added Sentry to one of our apps and we're getting a lot of these errors: Cannot read property 'type' of...
Read more >
Portal Comment TypeError: Cannot read property 'web...
Portal Comment TypeError: Cannot read property 'web' of undefined ... Hi Clofly,. Thanks a lot for your help! Replacing Xrm.ClientName.web by "Web" (in...
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