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.

Stepper with target ES6 - markForCheck Error

See original GitHub issue

Bug

Using a horizontal stepper produces an error:

ERROR TypeError: Cannot read property 'markForCheck' of undefined at MatHorizontalStepper._stateChanged (stepper.js:352)

There’s a Stackoverflow question (https://stackoverflow.com/questions/48036238/stepper-angular-material-cannot-read-property-markforcheck-of-undefined) . Both workarounds do work.

What is the expected behavior?

Should work out of the box with ES6 and plain ng serve.

What are the steps to reproduce?

Here’s a stackblitz, however it’s working - probably they’re not using plain ng serve but ng build?

https://stackblitz.com/edit/angular-ancwcw

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

ng: 7.0 ts: 3.1.3 Windows 10

EDIT: The stackblitz did not save my changes properly … see attachment instead. angular-5furhj.zip

EDIT 2: Updated stackblitz now working. I needed to create an account to save. Same as attachement.

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
johanswanepoelcommented, Oct 29, 2018

I am experiencing the same issue. Angular: 7.0.0 Angular/Material: 7.0.0 Typescript: 3.1.3 OS: Ubuntu 16.04

My tsconfig.json file:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

Chrome produces this error message:

ERROR TypeError: Cannot read property 'markForCheck' of undefined
    at MatHorizontalStepper._stateChanged (stepper.js:352)
    at MatStep.ngOnChanges (stepper.js:179)

Firefox produces this error message: ERROR TypeError: "this._changeDetectorRef is undefined"

Switching target back to ES5 as a workaround fix.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 10, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stepper - Cannot read property 'markForCheck' of undefined
1. Spent a few hours trying to figure why I was getting the error. My target was set to 'es2015', changing it to...
Read more >
angular/angular - Gitter
I am getting an error inside the function. whole code I am pasting here https://hastebin.com/uwelapomed.http. function getHttp(): HttpClient { ...
Read more >
@angular/cdk | Yarn - Package Manager
The Angular team builds and maintains both common UI components and tools to help you build your own custom components. The team maintains...
Read more >
UNPKG - @ssv/ngx.command
node_modules/tslib/tslib.es6.js","ng://@ssv/ngx.command/command.ts" ... return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, ...
Read more >
Advanced Angular Interview Questions You Must Prepare For ...
34. What are the generators in ES6? 35. Explain the Error mechanism in your application. 36. What is bootstrapping in Angular?
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