Skip to content

fix: resolve visualID render crash in Sketch component#1201

Closed
priyaa-j wants to merge 1 commit intoprocessing:mainfrom
priyaa-j:fix/sketch-visualid-render-crash
Closed

fix: resolve visualID render crash in Sketch component#1201
priyaa-j wants to merge 1 commit intoprocessing:mainfrom
priyaa-j:fix/sketch-visualid-render-crash

Conversation

@priyaa-j
Copy link
Contributor

Closes #1191
Description:
This PR adds a guard clause in Sketch.astro. Currently, when the OpenProcessing API fails (like a 403 or 500 error), the item variable becomes undefined, and the code tries to access item.visualID, which causes a TypeError and crashes the entire page.

Changes:
The fix adds a simple check at the top: if (!item) return This means if item is undefined or null, the component stops rendering immediately and never tries to access item.visualID so the page loads safely without crashing.

Verification:
The issue was already happening when the API failed when I run the server locally.

Without fix: API fails → item undefined → page crashes ❌
With fix: API fails → guard clause stops execution → page loads safely ✅

Tested locally on real API failure. Works perfectly.

@ksen0
Copy link
Member

ksen0 commented Feb 25, 2026

Closing for now, upstream bug was resolved - see linked issue

@ksen0 ksen0 closed this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Critical rendering crash in Sketch.astro when OpenProcessing API fails

2 participants