@@ -285,6 +285,9 @@ <h2>{{title}}</h2>
285285 submitButton . value = 'Sending...' ;
286286
287287 try {
288+ console . log ( 'Form submission started' ) ;
289+ console . log ( 'Current hostname:' , window . location . hostname ) ;
290+
288291 // For local development, load from config.json
289292 const getConfigPath = ( ) => {
290293 if ( window . location . hostname === 'localhost' ||
@@ -297,22 +300,28 @@ <h2>{{title}}</h2>
297300
298301 // This line will be replaced during build with the actual webhook URL
299302 let webhookUrl = null ;
303+ console . log ( 'Initial webhookUrl:' , webhookUrl ) ;
300304
301305 // Try to load from config for local development
302306 const configPath = getConfigPath ( ) ;
307+ console . log ( 'Config path:' , configPath ) ;
308+
303309 if ( configPath && ! webhookUrl ) {
304- console . log ( 'Loading config from:' , configPath ) ;
310+ console . log ( 'Attempting to load local config...' ) ;
305311 try {
306312 const configResponse = await fetch ( configPath ) ;
313+ console . log ( 'Config response:' , configResponse . status , configResponse . statusText ) ;
307314 if ( configResponse . ok ) {
308315 const config = await configResponse . json ( ) ;
309316 webhookUrl = config . webhookUrl ;
317+ console . log ( 'Loaded webhook from config:' , ! ! webhookUrl ) ;
310318 }
311319 } catch ( error ) {
312320 console . log ( 'Failed to load local config:' , error ) ;
313321 }
314322 }
315323
324+ console . log ( 'Final webhookUrl status:' , ! ! webhookUrl ) ;
316325 if ( ! webhookUrl ) {
317326 throw new Error ( 'Contact form is not properly configured. Please try again later.' ) ;
318327 }
0 commit comments