diff --git a/.changeset/fix-member-profile-photo-preview-scope.md b/.changeset/fix-member-profile-photo-preview-scope.md new file mode 100644 index 0000000000..fd8d6659a3 --- /dev/null +++ b/.changeset/fix-member-profile-photo-preview-scope.md @@ -0,0 +1,4 @@ +--- +--- + +Fix `parsed is not defined` ReferenceError in member profile photo preview. The `parsed` variable was declared with `const` inside a `try` block but referenced outside it; hoisting to `let` before the block resolves the scope error. diff --git a/server/public/member-profile.html b/server/public/member-profile.html index 20793f2518..ef1da0b0d8 100644 --- a/server/public/member-profile.html +++ b/server/public/member-profile.html @@ -2642,8 +2642,9 @@

Tags

} if (photoUrl) { + let parsed; try { - const parsed = new URL(photoUrl); + parsed = new URL(photoUrl); if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') { setPreviewMessage('Only http/https URLs allowed', 'var(--color-error-500)', '11px'); return;