
Mini lesson · English
How to find and fix errors on your live website
Reproduce a supplied broken visitor action, ask an assistant for a focused repair and verify the same action after the change.
Who is this for?
People who want to find and fix failures visitors encounter. You will use a supplied broken page; a coding assistant can change the code while you describe the problem and repeat the visitor action.
Before you start
The supplied separate practice site and a coding assistant. A Sentry practice project is optional for the monitoring part; send only the supplied synthetic errors and do not use private visitor data.
Estimated time: 19–31 min
Estimates for the supplied starter files with prerequisite accounts and tools ready. Setup, deployment queues and delivery/DNS waits take additional time. Monitoring provider setup and ingestion waits are additional. A local capture call is not proof of a received alert.
What you will learn
- Reproduce a real broken action rather than checking only page load.
- Share enough safe context for a focused assistant repair.
- Verify the fixed action and relevant monitoring state.
Step 1
Try the visitor action
A page can open while its useful feature is broken.
Have your assistant serve the supplied public folder over HTTP and open the page. Activate “Find contact section”. The supplied practice-R1 version deliberately looks for a target that is absent, so the status reports that the Contact action failed.
Tell the assistant the exact button, expected destination and visible result. The Contact section can exist on the page while the button still fails to reach it; a loaded homepage alone would miss this problem.
A concrete example
A useful symptom report is: “I pressed Find contact section in practice-R1. I expected the Contact section to open, but the status said Contact action failed.”
Use the supplied broken contact-action example in a separate practice site. Reproduce the button failure, identify a focused cause and change only what is necessary. Help me repeat the same action and compare before/after. If monitoring is enabled, use only synthetic errors and my own practice project; do not send private page or form data. Do not call an issue fixed merely because it was marked resolved.Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Find and fix a live website error
Start with a failed visitor action, then use a report to locate its cause.
Monitoring is useful when it connects a real symptom to code you can investigate. This practice page deliberately searches for a contact element that does not exist, so the contact action fails.
We send only a fixed synthetic error to your own Sentry project. The report includes a release label and stack location; the incident record connects that evidence back to what the visitor tried to do.
Worked example
The homepage itself loads successfully. Clicking “Find contact section” fails because the script asks for #contact-missing while the actual HTML has id=contact.
Extra implementation exercise
Why does an HTTP 200 homepage check fail to detect this bug?
Show a worked solution
The HTML can load correctly while a later JavaScript action fails. Repeat the contact task, not just the page request.
- Tests the affected interaction after page load.
- Distinguishes availability from functional correctness.
Common mistake
Declaring a JavaScript feature healthy because the server serves its HTML.
Step 2
Collect only safe useful context
Give the assistant evidence without private visitor data.
Give the assistant the practice files, page version and the symptom from the previous step. That is enough to start inspecting this local example without sending any real visitor’s form text or account information.
If you use the optional Sentry project, configure only its public loader value and enable practice monitoring before reproducing the controlled error. Inspect the matching practice event and its data. An event appearing in Sentry is separate from an alert reaching an inbox.
A concrete example
The supplied allowed error is “Practice: missing contact target”. A useful event can include the practice release and source location without a real user message, email address or account token.
Sentry: browser loader and custom initialization
Try it yourself
What context will you share, and what private data will you exclude?
Discuss your answer with the lesson tutor
Show a worked solution
I would share the supplied practice-R1 files, the “Find contact section” action and its failure message. With monitoring enabled, I would look for “Practice: missing contact target” and the matching release in my test project. I would exclude visitor emails, form text and account tokens; an inbox alert remains a separate check.
- Shares the reproducible synthetic action, practice release and relevant file context.
- Excludes real visitor content and distinguishes received monitoring events from delivered alerts.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Send a controlled diagnostic report
Collect enough to investigate without sending raw user content.
Configure the public project loader URL as described in START-HERE.txt. The script sets its initialization callback before loading the SDK, disables tracing/replay and uses a beforeSend allowlist for this fixed practice error.
The returned diagnostic event excludes request data, user data, arbitrary extras and breadcrumbs. Stack filenames have query/hash removed. For a real site, review every source of sensitive diagnostics; sendDefaultPii=false alone is not a guarantee that free text or URLs contain no personal information.
The beforeSend filter is intentionally strict: only the exact synthetic message 'Practice: missing contact target' is sent. Other messages are dropped. If you change the practice error's wording, update the allowlist deliberately or the missing event is expected. Do not remove the filter merely to make the dashboard busy; inspect the allowed event payload for unintended data.
If no event arrives, first inspect the fixed message string and beforeSend allowlist in app.js. A nonmatching event now displays a local filtered-event message; it is not counted as sent. The URL parser uses location.origin as its base for relative filenames and replaces an unparseable filename with redacted rather than forwarding a potentially sensitive original.
The loader’s documented data-lazy="no" option is set by script.dataset.lazy="no"; it asks the full SDK to load early. Stack filenames retain only HTTP(S) origin/path after removing query/hash. Non-web schemes are redacted rather than forwarded unchanged.
Worked example
A fixed error message such as “Practice: missing contact target” is enough for this exercise. Sending an entire form object would add risk without helping identify the missing DOM target.
Sentry: browser loader and custom initialization
Extra implementation exercise
Would disabling default PII automatically make arbitrary error messages safe to send?
Show a worked solution
No. Review the actual event payload and restrict what your own code sends. Personal data can appear in messages, URLs, breadcrumbs and extras even without default PII collection.
- Recognizes application text/URLs may still contain private data.
- Applies explicit redaction/allowlisting.
Common mistake
Treating a single privacy option as a complete payload review.
Step 3
Apply one focused repair
Repeat the exact failed action after the change.
Ask your assistant to compare the failing button’s destination with the existing Contact section. The supplied worked-solution/app.js contains the small target repair; have it apply that change and label the fixed practice revision practice-R2.
Open the updated practice-R2 page and activate the same button again. It should reach Contact and show “Contact section opened.” Changing only the release label or marking an issue resolved in Sentry does not change the button’s behavior.
A concrete example
The faulty script searches for #contact-missing while the HTML defines Contact at #contact. The assistant can repair that match; you judge the outcome by using the button again.
Try it yourself
What changed, and what happened when you repeated the original action?
Discuss your answer with the lesson tutor
Show a worked solution
In the supplied solution, the assistant changes the lookup from the missing target to the existing #contact section and labels the revision practice-R2. The expected retest is that the same button reaches Contact and shows “Contact section opened.” A resolved monitoring label without that retest would not establish the repair.
- Connects the small destination repair to the existing Contact section.
- Repeats the same action on the updated version and checks the user-visible outcome.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Match the report, repair the cause and retest
A resolved issue label does not repair the code.
Enable monitoring, trigger the synthetic failure and locate the actual event in your account. Compare its release and frame with the supplied source. If no event arrives, inspect loading, blockers, project configuration and network delivery before assuming there was no error.
Replace the script with worked-solution/app.js, update the release label and repeat the contact action. The correct target should scroll into view. Setting an issue to resolved in a dashboard does not substitute for this behavioural check.
The file replacement is a small lab representation of a source fix. On a hosted practice site, commit the changed app.js and release label, review/deploy that revision, then retest its public URL. Updating only the issue status or release label does not apply the selector fix.
Worked example
R1 fails on #contact-missing; R2 uses #contact. The meaningful recovery evidence is that the contact action now works on the fixed revision.
Extra implementation exercise
The issue is marked resolved but the deployed script still queries #contact-missing. Is the problem repaired?
Show a worked solution
No. A dashboard status cannot change the script. Deploy the fix through the review process and verify the action on that revision.
- Checks the actual deployed source/revision.
- Repeats the previously failing action.
Common mistake
Changing issue status instead of shipping and verifying a fix.
Step 4
Finish a useful incident note
Keep symptom, repair and verification connected.
Complete incident-record.txt with the original button failure, the small target correction and the result of repeating the action on the updated page. If you publish the practice change, check that exact published version rather than only the local file.
Keep optional monitoring observations separate: whether the original event reached Sentry, whether you configured an alert and whether a notification actually arrived. The record should explain this repaired task and any remaining gap, not claim the whole site has no errors.
A concrete example
A compact incident note connects practice-R1’s failed Contact action to the target correction and practice-R2’s successful retest. “Issue resolved” by itself omits the visitor result.
Try it yourself
Start with these materials
The starter files and test content are supplied. A live verification still requires your own permitted provider account, inbox or domain as listed under prerequisites. Local inspection is possible without them; record the live step as not tested until you actually perform it.
Provide the incident record and the actual fixed-action check.
What to produce A short incident record with the reproduced symptom, bounded change and actual successful retest.
Discuss your answer with the lesson tutor
Show a worked solution
Illustrative incident record: practice-R1’s Contact button reported failure; the assistant corrected the missing target; on practice-R2 the same button reached Contact and showed its success message. The synthetic event was checked separately in the test monitoring project. No alert rule was configured, so notification delivery is untested. This record covers that Contact defect, not every future site error.
- Links the original symptom, focused change and actual same-action retest on the identified version.
- Separates provider event/alert observations and names any remaining untested scope.
Files for this step
Open or download the files below. When saving a project, keep the folder paths shown in the filenames.
How it works (optional)
Your assignment: write a useful incident note
Make the next investigator understand both the cause and the evidence.
Complete the incident record with a redacted event reference, affected action, source frame, root cause and successful retest. If you configure an alert, verify the actual notification separately from event ingestion.
Add one second synthetic failure in your own practice copy and repeat the loop. Keep messages fixed and update the allowlist deliberately; do not broaden monitoring by sending arbitrary page/form data.
Worked example
“Missing target selector fixed from #contact-missing to #contact; R2 retest passed” is actionable. “Sentry had an error; resolved” leaves the cause and verification unknown.
The complete reference walkthrough is available in reference/assignment-walkthrough.txt. Compare its steps with your own result; fill the test record from observations in your own project.
Extra implementation exercise
Produce an incident note and prove the fixed user action works.
Show a worked solution
Enable the configured practice loader and trigger the exact synthetic error. If you change the error text, update the strict allowlist intentionally; a dropped non-allowlisted message is expected. Inspect the actual received event for its release/frame and unwanted data.
Apply the supplied fixed script to public/app.js and change RELEASE to practice-R2. Publish that practice revision through the reviewed workflow, then repeat Find contact section on the actual deployed URL. Changing only the release label or issue status cannot repair the selector.
Record issue ingestion separately from alert notification delivery. The event may be visible before a configured alert arrives; keep either observation pending until checked. The reference incident note ties the failure, frame, selector change and user-visible retest together.
- Links symptom, release and source cause.
- Verifies behaviour and keeps event/notification delivery claims separate.
Common mistake
Assuming an empty monitoring dashboard proves users see no errors.
Was this lesson useful?
Leave a like, or share it with someone who could use it.
Continue learning
- How to build your first personal website
- How to publish your website from GitHub
- How to connect a custom domain to your website
- How to set up email on your own domain
- How to make your website usable on phones
- How to make website images load faster
- How to get website feedback in your inbox
- How to add email subscriptions to your website
- How to send automated emails from your website
- How to save form submissions in a database
- How to let people sign in to your website
- How to keep a page private
- How to let users edit their profile information
- How to let users upload images
- How to keep API keys out of your frontend
- How to show data from an external API on your website
- How to add an AI chatbot to your website
- How to make a chatbot answer from your own content
- How to add a blog to your website
- How to add search to your website
- How to add another language to your website
- How to help Google find your website
- How to fix your website preview when sharing a link
- How to measure visits and useful actions on your website
- How to let visitors book an appointment
- How to accept a payment on your website
- How to preview website changes before publishing
- How to undo a broken website deployment
- How to back up and restore your website data