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#iffor conditional blocks orifused for the submit button’s icon), it rendered correctly without errors when opened viamodal.show()triggered from the button component added via thepost-menu-buttonsvalue 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/ previouslyAttempted 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.gjsorfeedback-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
-
You are running the latest Discourse development environment version.
-
Log in as any user.
-
Navigate to any topic and view the first post.
-
Click the “Test Failing Modal” button added to the post menu.
-
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.