File tree Expand file tree Collapse file tree
packages/web/src/app/[domain] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export const AskSourcebotDemoCards = ({
116116 const context = demoExamples . searchContexts . find ( ( context ) => context . id === contextExample . searchContext )
117117 if ( ! context ) {
118118 console . error ( `Search context ${ contextExample . searchContext } not found on handleContextClick` ) ;
119- return ;
119+ return null ;
120120 }
121121
122122 const isSelected = selectedItems . some (
Original file line number Diff line number Diff line change @@ -51,7 +51,14 @@ export default async function Home({ params: { domain } }: { params: { domain: s
5151 searchModeCookie ?. value === "precise"
5252 ) ? searchModeCookie . value : models . length > 0 ? "agentic" : "precise" ;
5353
54- const demoExamples = env . SOURCEBOT_DEMO_EXAMPLES_PATH ? await loadJsonFile < DemoExamples > ( env . SOURCEBOT_DEMO_EXAMPLES_PATH , demoExamplesSchema ) : undefined ;
54+ const demoExamples = env . SOURCEBOT_DEMO_EXAMPLES_PATH ? await ( async ( ) => {
55+ try {
56+ return await loadJsonFile < DemoExamples > ( env . SOURCEBOT_DEMO_EXAMPLES_PATH ! , demoExamplesSchema ) ;
57+ } catch ( error ) {
58+ console . error ( 'Failed to load demo examples:' , error ) ;
59+ return undefined ;
60+ }
61+ } ) ( ) : undefined ;
5562
5663 return (
5764 < div className = "flex flex-col items-center overflow-hidden min-h-screen" >
You can’t perform that action at this time.
0 commit comments