-
-
Notifications
You must be signed in to change notification settings - Fork 638
Add centralized help and support messaging system #1803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
55b820a
2c67f41
8e1875d
e7a3b6a
8976d09
f769676
882b43c
6c21f69
0e0f18b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,6 +77,7 @@ def exec_server_render_js(js_code, render_options, js_evaluator = nil) | |||||||||||||||||||||||
| if err.message.include?("ReferenceError: self is not defined") | ||||||||||||||||||||||||
| msg << "\nError indicates that you may have code-splitting incorrectly enabled.\n" | ||||||||||||||||||||||||
| end | ||||||||||||||||||||||||
| msg << "\n#{Utils.default_troubleshooting_section}\n" | ||||||||||||||||||||||||
| raise ReactOnRails::Error, msg, err.backtrace | ||||||||||||||||||||||||
|
Comment on lines
+80
to
81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Append help once and use dynamic README-backed content. This risks duplicate help blocks when wrapped by higher-level errors and uses the static default. Apply this diff: - msg << "\n#{Utils.default_troubleshooting_section}\n"
+ msg << "\n#{Utils.help_and_support_section}\n" unless msg.include?('Get Help & Support:')📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| end | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -122,7 +123,7 @@ def read_bundle_js_code | |||||||||||||||||||||||
| rescue StandardError => e | ||||||||||||||||||||||||
| msg = "You specified server rendering JS file: #{server_js_file}, but it cannot be " \ | ||||||||||||||||||||||||
| "read. You may set the server_bundle_js_file in your configuration to be \"\" to " \ | ||||||||||||||||||||||||
| "avoid this warning.\nError is: #{e}" | ||||||||||||||||||||||||
| "avoid this warning.\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}" | ||||||||||||||||||||||||
| raise ReactOnRails::Error, msg | ||||||||||||||||||||||||
| end | ||||||||||||||||||||||||
|
Comment on lines
124
to
128
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve original backtrace when re-raising; also prefer dynamic help. Current raise drops Apply this diff: - msg = "You specified server rendering JS file: #{server_js_file}, but it cannot be " \
+ msg = "You specified server rendering JS file: #{server_js_file}, but it cannot be " \
"read. You may set the server_bundle_js_file in your configuration to be \"\" to " \
- "avoid this warning.\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}"
- raise ReactOnRails::Error, msg
+ "avoid this warning.\nError is: #{e}\n\n#{Utils.help_and_support_section}"
+ raise ReactOnRails::Error, msg, e.backtrace📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -149,7 +150,8 @@ def create_js_context | |||||||||||||||||||||||
| msg = "ERROR when compiling base_js_code! " \ | ||||||||||||||||||||||||
| "See file #{file_name} to " \ | ||||||||||||||||||||||||
| "correlate line numbers of error. Error is\n\n#{e.message}" \ | ||||||||||||||||||||||||
| "\n\n#{e.backtrace.join("\n")}" | ||||||||||||||||||||||||
| "\n\n#{e.backtrace.join("\n")}" \ | ||||||||||||||||||||||||
| "\n\n#{Utils.default_troubleshooting_section}" | ||||||||||||||||||||||||
| Rails.logger.error(msg) | ||||||||||||||||||||||||
| trace_js_code_used("Error when compiling JavaScript code for the context.", base_js_code, | ||||||||||||||||||||||||
| file_name, force: true) | ||||||||||||||||||||||||
|
|
@@ -227,7 +229,7 @@ def file_url_to_string(url) | |||||||||||||||||||||||
| encoding_type = match[:encoding] | ||||||||||||||||||||||||
| response.body.force_encoding(encoding_type) | ||||||||||||||||||||||||
| rescue StandardError => e | ||||||||||||||||||||||||
| msg = "file_url_to_string #{url} failed\nError is: #{e}" | ||||||||||||||||||||||||
| msg = "file_url_to_string #{url} failed\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}" | ||||||||||||||||||||||||
| raise ReactOnRails::Error, msg | ||||||||||||||||||||||||
| end | ||||||||||||||||||||||||
|
Comment on lines
+232
to
234
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve backtrace and avoid duplicate/static help. Apply this diff: - msg = "file_url_to_string #{url} failed\nError is: #{e}\n\n#{Utils.default_troubleshooting_section}"
- raise ReactOnRails::Error, msg
+ msg = "file_url_to_string #{url} failed\nError is: #{e}\n\n#{Utils.help_and_support_section}"
+ raise ReactOnRails::Error, msg, e.backtrace📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid duplicate help blocks; prefer dynamic content with fallback.
If upstream raises an error that already includes the help section,
PrerenderErrorwill append it again. Also, this uses the static default rather than the dynamically extracted README block.Apply this diff:
And add these helpers in
lib/react_on_rails/utils.rb:🤖 Prompt for AI Agents