GJS component fails with "undefined helper" error when shown via modal service (Discourse 3.5.0

Hello,

Following up on this issue: I created the minimal-modal-test plugin as suggested.

  • Success: When the test plugin’s modal component (minimal-modal.gjs) contained only basic elements (like <p>, <textarea>, core <DModal>, <DButton>, and even built-in helpers like #if for conditional blocks or if used for the submit button’s icon), it rendered correctly without errors when opened via modal.show() triggered from the button component added via the post-menu-buttons value transformer. This confirms the basic modal service, component rendering, value transformer, and built-in helpers seem functional in isolation in my environment (Discourse v3.5.0.beta3-dev).

  • Failure: The error (TypeError: userProvidedCallback is undefined / previously Attempted to use a value as a helper... undefined) reappears consistently the moment I add the child component <StarRatingInput> back into the modal’s template (minimal-modal.gjs or feedback-form-modal.gjs).

I have ensured the StarRatingInput component itself uses workarounds identified earlier (inline SVG instead of dIcon helper, arrow functions for methods like starClass to fix this context, standard JS Array.from instead of the range helper). The internal code of StarRatingInput seems correct now.

This points to the error being triggered by rendering the nested <StarRatingInput> component (which contains an #each loop, dynamic class bindings, and event handlers) inside the parent modal component within this specific rendering context.

https://github.com/rahul-rakesh/discourse-modal-render-test

Steps to Reproduce

  1. You are running the latest Discourse development environment version.

  2. Log in as any user.

  3. Navigate to any topic and view the first post.

  4. Click the “Test Failing Modal” button added to the post menu.

  5. Open the browser’s developer console.

Expected Result

A simple modal dialog should appear containing a star rating input.

Actual Result

The modal fails to render completely. The browser console shows an error.