Skip to content

Commit 86a59e8

Browse files
author
Gerome El-assaad
committed
Fix critical template parameter error causing build failures
- Fix template passing in page.tsx to always use full templates object - Add null safety check in templates.ts to prevent undefined lib property access - Remove unused currentTemplate variable This resolves the 'Cannot read properties of undefined (reading join)' error that was preventing successful builds and message submissions.
1 parent d42e5a7 commit 86a59e8

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

app/api/sandbox/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export async function POST(req: Request) {
8080
await Promise.all(fragment.code.map(async (file) => {
8181
await sbx.files.write(file.file_path, file.file_content)
8282
}))
83-
} else {
8483
} else if (fragment.code !== null && fragment.code !== undefined) {
8584
await sbx.files.write(fragment.file_path, fragment.code)
8685
} else {

app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export default function Home() {
278278
userID: session?.user?.id,
279279
teamID: userTeam?.id,
280280
messages: toAISDKMessages(updatedMessages),
281-
template: templates[selectedTemplate],
281+
template: templates,
282282
model: currentModel,
283283
config: languageModel,
284284
})

hooks/use-enhanced-chat.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ export function useEnhancedChat(chatConfig: EnhancedChatConfig) {
109109

110110
trackError(error.message)
111111
throw error
112-
} finally {
113-
if (retryCount > 0) {
114-
setIsSubmitting(false)
115-
}
116112
} finally {
117113
setIsSubmitting(false)
118114
}

0 commit comments

Comments
 (0)