Troubleshooting techniques

This section describes some common troubleshooting techniques to debug and improve your apps.

✔️Constant re-rendering detected

If you're experiencing performance issues or encountering the "Constant re-renders detected" message, this could point to a cyclic dependency in your app or other performance-related issues:

  • Use of Math.random() or new Date().getTime() in computed component properties: Such declarations generate a new unique value every time UI Bakery re-renders the page. As a result, components produce new state values in component variables like {{ui.input.value}}, which subsequently triggers another re-render. It's advisable to avoid such declarations.

  • Cyclic dependencies in component configurations: For example, you might have two input components where each input references the value of the other input (i.e., {{ui.input.value}}) as its Value property. This setup can lead to continuous re-renders and may significantly impede the app's performance.

  • Infinite cycles in action code: Check for loops like while(true) that might continuously produce new values, leading to persistent re-renders.

  • Improper use of UI Bakery state variables: Utilizing broad scopes, such as {{state}} or {{actions}} in component properties, can prompt UI Bakery to continuously update the page, ensuring it reflects the most recent values. It's recommended to modify these references to point to precise values, like {{state.variableName}}.

✔️ Disable actions execution to debug freezes and redirects

To address situations such as:

  • an action redirecting you to another page on a page load

  • an action consuming a lot of resources and freezing the app

you can disable actions execution for debugging purposes. To do so:

  • append the ?uib_skip_actions_execution=1 query parameter in the URL

  • reload the app page

This will activate a special mode where actions can only be executed by clicking the Run action button manually, and will not be executed on Page Load or other component triggers.

This should allow you to fix any issues with your actions. Remember to remove the parameter and reload the page to ensure that the fix is in place. Note that this will not affect the published version of the app.

Last updated

© 2024 UI Bakery