How to Debug in Momen
Last updated
Last updated
Debugging is a critical aspect of application development. Learning how to observe issues, pinpoint errors, and resolve problems in cases of errors and exceptions is a fundamental skill for developers. Among these, observation is the most crucial step, serving as the foundation for subsequent actions. Therefore, this document primarily focuses on how to observe and extract necessary information in Momen.
Momen categorizes errors into three types: Editing Errors, Deployment and Publishing Errors, and Runtime Errors. This document provides guidance on how to debug each type of error.
The error icon in the top-right corner of the editor displays a number.
Click the icon to navigate to the error and modify the issue based on the error message.
Below are two examples:
Example 1: Type Error
Type mismatch in component, action, or bound data.
Expected type: (Null | Nothing | Int)
Actual type: String
Analysis & Solution: Entering "$1" in a price field triggers a type error since the field requires an integer value. Remove the "$" symbol to resolve the issue.
Example 2: Missing Required Field
The system detects that a required field is not provided.
Modify the field according to the error message.
Error during preview update.
Backend deployment failure.
Check the error message (if available).
Fix the issue based on the provided error details. If unclear, ask AI for assistance.
Report the issue to our team.
Example: Backend Update Failure
Solution: Click "Report Issue," and the support team will handle it.
Components that appear aligned in the editor may be misaligned in the preview.
Components that fit within the editor may exceed the screen width on mobile devices.
Check UI Design Configurations
Example 1: Two components appear left-aligned in the editor, but one uses relative positioning while the other uses absolute positioning. This causes misalignment on different screen widths.
Example 2: A text component inside a view component overflows. To fix this, change the view’s overflow setting from "visible" to "hidden" or "scroll."
Report Possible Bugs
If no configuration errors are found, report the issue to our team.
When a request error occurs, the frontend page or request log usually displays an error message.
Use the Request Error Reference to diagnose and resolve common errors
Alternatively, AI can help analyze errors based on logs and request data. Below is the prompt for reference (add your own information in step 5)
Find Errors in Browser Using Developer Tools or in Momen's Log
Browser: Press F12
or right-click > "Inspect" > Open debugging mode > Click Network
> Find graphql-v2
requests.
Momen Logs: Click "Logs" in the editor for more detailed logs.
In a request, we need to focus on:
Request Body: Contains critical information about the query structure and parameters. Find detailed information in "playload".
An example:
The query section contains the query statement, which defines the structure of the requested data. From this example, we can see that the query is targeting the blog_article table and is limited to retrieving two records (limit: 2
).The variables section contains the parameters for this query, corresponding to the filter conditions, sorting, and deduplication settings configured in the editor. In this example, the "where"
condition filters records where the title contains "AI", and the "orderBy"
condition sorts the results in ascending order by "created_at".
Response Body: Displays results and errors. Look for errors
in the response when debugging.
An example: Permission Error Response:
By examining the request body, check whether the query statements and parameters match the configurations in the editor.
By analyzing the response body, check for any errors and verify if the results meet expectations.
Once enough information is gathered, make an educated guess about the possible cause of the issue and attempt to fix it.
If the cause of the error cannot be determined, provide the collected information to AI and refer to the prompt in Step 1 for assistance.
Payment/Refund Error:
If a refund action fails, check the logs. If it's a permission issue, verify the project’s permission settings.
API Execution Error:
Check request logs to find required fields that are missing values.
Actionflow Execution Failure:
If an error occurs due to a missing field (e.g., foodwcost
instead of foodcost
), correct the field name.
Database Constraint Violations:
Ensure unique values are not duplicated when inserting data.
Conditional Component Display Issue:
If a component’s visibility depends on a data source (e.g., status should be "false" but is actually "true"), check the request to ensure data accuracy.
Check the configuration logic of each functional module one by one. For example:
Form: Ensure that field types, required rules, and data validation conditions are reasonable.
Actionflow: Verify the step sequence, conditional branches, and permission assignments.
Data Relationships: Check whether related fields between tables match.
Dependency Troubleshooting: If third-party services are used, check the connectivity and parameter configurations of external integration services.
Official Documentation: Check our doc for more details.
Community Support: Post questions on forum.momen.app or send email to us (hello@momen.app).
Provide detailed descriptions, including:
Expected action
Steps attempted
Error details (screenshots/logs preferred)
Example of a good question: "I'm expecting X, but getting Y. I tried A and B. The issue appears on page C, component D. Here’s the error message: [screenshot]."
Example of a bad question: "Why is my preview broken?"