Skip to content

Frontend Troubleshooting

This page covers common client-side issues in Serene/StartSharp applications and how to fix them.

Type Registration Failures

"The editor class 'X' was not found"

This error appears when the EditorTypeRegistry cannot find an editor type by its key. The error message itself suggests the fix:

The editor class "MyProject.MyModule.MyEditor" was not found.

Ensure that the editor type includes a line similar to the following (using the correct full name):
static [Symbol.typeInfo] = this.registerEditor("MyProject.MyModule.MyEditor");

Also, side-effect import this editor class from the current page.ts, grid.ts, or dialog.ts file. For example:
import "./path/to/MyEditor.ts";

After applying the fixes, build the project by running "npm run build" from the project folder.

Common causes:

  • The editor is not registered with registerEditor (or formatterTypeInfo for formatters).
  • The editor module is not side-effect imported — the class must be imported somewhere so its static { registerType(this) } block runs.
  • The type name doesn't match the key used in the form/column metadata.

"The element already has widget 'X'!"

Only one widget of the same class can be attached to an element. If you create a second widget of the same class on the same element, this error is thrown. Use a different element, or destroy the existing widget first.

Missing Grid Refreshes

If a grid doesn't refresh after a dialog saves:

  • The dialog must notify the grid via SubDialogHelper.bindToDataChange (EntityGrid does this automatically).
  • Check that the dialog's onSaveSuccess runs and that the grid's subDialogDataChange() is called.
  • If you open a dialog manually, bind it to the grid yourself:
SubDialogHelper.bindToDataChange(dialog, this, () => {
    this.refresh();
});

Binding Issues

Editor value not loading/saving

  • The editor must implement the value interfaces the form expects (IGetEditValue/ISetEditValue, or IStringValue/IDoubleValue/IBooleanValue).
  • Check that the editor is registered with the correct interfaces:
static override[Symbol.typeInfo] = this.registerEditor("MyApp.MyEditor", [IGetEditValue, ISetEditValue]);
  • For custom editors, verify get_value/set_value (or getEditValue/setEditValue) are implemented correctly.

Signal Updates Not Reflecting

If a signal-driven DOM update doesn't appear:

  • Make sure the signal is actually being read inside the JSX (e.g. {count} or class={sig}), not just assigned once.
  • Check that the signal is being mutated via .value = ..., not reassigned.
  • If the element was removed and re-added, the signal subscription may have been disposed — re-render the element.

Validation Not Working

  • Validation rules are attached with addValidationRule and run on form submit.
  • A rule returns null/empty for valid, a string for invalid.
  • If a field isn't validated, check that it has a name attribute and is inside the form.
  • Rules the server declared for a field (PropertyItem.validationRules) are attached by the PropertyGrid through the ValidationRuleTypeRegistry, and skipped for read-only and hidden fields — if a field's server rule isn't applied, make sure the rule class is registered by its type key (static override [Symbol.typeInfo] = this.registerRule("MyApp.")) and, for a rule implementing LazyLoadInclude, that the layout head includes @Html.LazyTypes().
  • A lazily loaded editor can't save its value until its widget exists: wait for PropertyGrid.getEditorsLoading() before saving.
  • A field hidden by a visibleWhen condition is not validated (and is not required) — see Conditional Fields.
  • If code that looks up a field's editor finds a select2 container instead, it is targeting the container, which now carries editor-like rather than editor.

Service Errors

"NotAuthorized" / session expired

  • The user's session expired. Configure Config.notLoggedInHandler to redirect to login:
Config.notLoggedInHandler = () => window.location.href = "/Account/Login";

Service call fails with a validation error

  • The server returned a ServiceError. Handle it with try/catch or onError:
try {
    await MyService.Save(request);
}
catch (e) {
    notifyError(e.Message);
}

"TooManyRequests" on an account action

The account rate limiter rejected the request (HTTP 429) because too many POST requests came from the same IP address to login, forgot/reset password, sign up or elevate. The page shows the localized Validation.TooManyRequests message, and the response has a Retry-After header. Raise AccountRateLimit:PermitLimit or WindowSeconds, or turn a path off with PermitLimit: 0, see Account Rate Limiting.

Scripts and Modules Not Loading

A form or grid is empty, with an access denied error

Form and columns scripts can require a permission, so the client does not receive the metadata of the ones the user cannot open. A form that anonymous users need must declare Permission = "*", and one that any logged-in user needs "?"; otherwise the script follows the ReadPermission of its [BasedOnRow] row when PropertyItemsScripts:PublicByDefault is false (the templates set it). A script the user cannot access is left out of the form/columns bundle, and reading it directly is denied. See Property item scripts.

A page module returns 404

With the ESM access control on, the modules under the esm folders are served only to users allowed to load an entry point (e.g. a page) that imports them. A 404 means the user lacks the permission of the page that reaches the module, or the module is not in the build.esm-manifest (e.g. the build did not run tsbuild, or the file is not imported by any entry point). A page that loads the modules of another page (e.g. to open its dialog) also needs the permission of that module for the user. See ESM Access Control.

Texts are missing from a page

When LocalTextPermissions:Enabled is on, the client receives only the texts the current user may see: row texts follow the ReadPermission of the row, form and columns texts the permission of their script, enum texts the permission of the enum, and Permission. texts PermissionTextsPermission. A text that is missing for a user who should see it can be opted out with AlwaysInclude, or protected differently with Restrict, see Filtering Local Texts by Permission.

See Also