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.

bug: large header causes type error / race condition

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior: Sometimes when navigating/scrolling between various pages relatively fast I see an error in console:

TypeError: undefined is not an object (evaluating 'this.collapsibleMainHeader.classList')

Expected behavior: No error is thrown, large header also works in rare situations where this.collapsibleMainHeader may be undefined for whatever reason.

Steps to reproduce: Navigate and scroll around an app that uses large headers, sooner or later the bug appears. Not very consistent but yeah that’s the problem with race conditions et al.

Related code: The error is caused by this line of code: https://github.com/ionic-team/ionic/blob/215d55f1ebeb93988b513c5869faae14d1d51919/core/src/components/header/header.tsx#L132

Possible fix: use optional-changing instead of non-null assertion.

Ionic info:

Ionic:

   Ionic CLI                     : 6.2.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.4
   @angular-devkit/build-angular : 0.900.5
   @angular-devkit/schematics    : 9.0.5
   @angular/cli                  : 9.0.5
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.2, (and 27 other plugins)

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   ios-deploy : 1.9.2
   ios-sim    : 8.0.2
   NodeJS     : v12.4.0 (/usr/local/bin/node)
   npm        : 6.11.3
   OS         : macOS Catalina
   Xcode      : Xcode 11.3.1 Build version 11C504

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidStrauszcommented, Mar 10, 2020

Thank you very much Liam, your help is much appreciated! 😃

1reaction
liamdebeasicommented, Mar 10, 2020

Hmm that’s strange. I’ll merge in the change that keeps the app working, but will dig into the other visual glitch some more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Race condition causes requests that will never be responsed
When two or more requests are received simultaneously by PEP proxy, at least one of them can be blocked (a request that is...
Read more >
Race Condition in Web Applications - Wallarm
The race condition occurs both in multithreaded applications and in the databases in which they work. Read all the details in our article....
Read more >
5. Concurrency and Race Conditions - Linux Device Drivers ...
This sequence of events is a demonstration of a race condition . Race conditions are a result of uncontrolled access to shared data....
Read more >
What is a Race Condition? - TechTarget
This kind of race condition happens when two processes read a value in a program and write back a new value. It often...
Read more >
Attacking the Brain: Races in the SDN Control Plane - USENIX
ing harmful race conditions in the SDN controllers, simi- ... tion (e.g., TCP header fields and types of control mes-.
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