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: side menu throwing asserts

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior: Web preview enters debug mode after trying to access a page from the side menu

Expected behavior: Not enter debug mode. I’m not really sure if that’s intended or not.

Steps to reproduce: Trying to access a page through the side menu causes the application to enter debug mode. This happens only on the first time. It just happened on web preview, but didn’t test on native run. The debug apparentely points to a file inside node modules. The path is as follows:

node_modules/@ionic/core/dist/esm-es5/chunk-c90aaa66.js

and the line indicated is line 40

var assert = function (actual, reason) {
    if (!actual) {
        var message = 'ASSERT: ' + reason;
        console.error(message);
        debugger; // tslint:disable-line
        throw new Error(message);
    }

It also throws this error during debug: ASSERT: _before() should be called while animating

And this one after debug: Unhandled Promise rejection: ASSERT: _before() should be called while animating ; Zone: <root> ; Task: Promise.then ; Value: Error: ASSERT: _before() should be called while animating

Related code:

var assert = function (actual, reason) {
    if (!actual) {
        var message = 'ASSERT: ' + reason;
        console.error(message);
        debugger; // tslint:disable-line
        throw new Error(message);
    }

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.4 (/home/rodrigo/.nvm/versions/node/v10.15.3/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.7.4
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 14 other plugins)

Utility:

   cordova-res : 0.6.0 (update available: 0.8.0)
   native-run  : 0.2.8 (update available: 0.2.9)

System:

   Android SDK Tools : 26.1.1 (/home/rodrigo/Android/Sdk)
   NodeJS            : v10.15.3 (/home/rodrigo/.nvm/versions/node/v10.15.3/bin/node)
   npm               : 6.11.3
   OS                : Linux 4.15

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:10
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
nogamenofun98commented, Dec 7, 2019

@digaus

by removing ion-menu-toggle that wrap the logout button in html, it solved the problem, Thanks~ 😄

*I didn’t add MenuGuard into the routing.

6reactions
aswinaryalcommented, Oct 22, 2019

could this bug be prioritized higher ? it’s blocking the production ready application.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: side menu throwing asserts · Issue #19676 · ionic-team ...
Hey, have been seeing this issue where the debugger statement pauses the app while the inspector is open. Please at the very least...
Read more >
JDK-8124572 MenuButton: PopupSide(Side.TOP ... - Bug ID
Raise the priority because in RTL orientation, menu is still popped up to incorrect place. This looks ugly for cascade menu. Please see...
Read more >
c# - Debug.Assert vs Exception Throwing - Stack Overflow
Your test and throw code will always run, while asserts can be compiled away. ... On the other hand, exceptions: "Use exception handling...
Read more >
Bug Patterns - Error Prone
Consider using AutoAnnotation instead of implementing Annotation by hand. ... This assertion throws an AssertionError if it fails, which will be caught by ......
Read more >
GotW #97 Solution: Assertions (Difficulty: 4/10) - Herb Sutter
GUIDELINE: Asserted conditions should never have side effects on normal execution. Assertions are only about finding bugs, not doing program ...
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