You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Enhanced error handling in simple-contact-form.js
- Added proper JSON/non-JSON response handling for Formspree
- Enabled console logging in production (drop_console: false)
- Added network timeout protection (30 seconds)
- Improved error messages with specific details
- Fixed script tag to use type='module' for proper Vite bundling
- Added debug tools for testing form submissions
The contact form now properly handles Formspree responses and provides
better debugging information when issues occur.
thrownewError('Formspree rejected the submission');
81
+
}
82
+
}catch(jsonError){
83
+
console.error('Failed to parse JSON response:',jsonError);
84
+
// Continue anyway - Formspree might return success without JSON
85
+
}
86
+
}else{
87
+
console.warn('Non-JSON response from Formspree. Content-Type:',contentType);
88
+
// Try to read as text
89
+
consttextResponse=awaitresponse.text();
90
+
console.log('Text response:',textResponse);
91
+
}
92
+
93
+
console.log('Form submission successful! Check your email.');
94
+
53
95
// Hide form and show success
54
96
form.style.display='none';
55
97
if(successMessage){
56
98
successMessage.style.display='block';
57
99
}else{
58
-
alert('Thank you! Your message has been sent.');
100
+
alert('Thank you! Your message has been sent.\n\nNote: If you don\'t receive an email, check:\n1. Your spam folder\n2. Formspree dashboard\n3. That the form is activated');
0 commit comments