File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed 
packages/kit/src/core/config Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ ' @sveltejs/kit ' minor 
3+ --- 
4+ 
5+ feat: redact internal stack trace when reporting config errors
Original file line number Diff line number Diff line change @@ -69,7 +69,15 @@ export async function load_config({ cwd = process.cwd() } = {}) {
6969
7070	const  config  =  await  import ( `${ url . pathToFileURL ( config_file ) . href } ${ Date . now ( ) }  ) ; 
7171
72- 	return  process_config ( config . default ,  {  cwd } ) ; 
72+ 	try  { 
73+ 		return  process_config ( config . default ,  {  cwd } ) ; 
74+ 	}  catch  ( e )  { 
75+ 		const  error  =  /** @type  {Error } */  ( e ) ; 
76+ 
77+ 		// redact the stack trace — it's not helpful to users 
78+ 		error . stack  =  `Could not load svelte.config.js: ${ error . message }  ; 
79+ 		throw  error ; 
80+ 	} 
7381} 
7482
7583/** 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments