Skip to content

Commit 9e69082

Browse files
Runtime Error
Error: A "use server" file can only export async function
1 parent 255b33d commit 9e69082

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/ai/flows/edit-file-content-ai.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
import {ai} from '@/ai/genkit';
1212
import {z} from 'genkit';
1313

14-
export const EditFileContentAIInputSchema = z.object({
14+
const EditFileContentAIInputSchema = z.object({
1515
currentContent: z.string().describe('The current content of the file.'),
1616
userPrompt: z.string().describe('A prompt from the user describing the desired changes.'),
1717
});
1818
export type EditFileContentAIInput = z.infer<typeof EditFileContentAIInputSchema>;
1919

20-
export const EditFileContentAIOutputSchema = z.object({
20+
const EditFileContentAIOutputSchema = z.object({
2121
newContent: z
2222
.string()
2323
.describe('The complete, new content of the file after applying the edits.'),
@@ -62,8 +62,11 @@ const editFileContentAIFlow = ai.defineFlow(
6262
// Fallback or error handling if AI doesn't return expected output
6363
console.error("AI did not return the expected new content for file editing.");
6464
// Optionally, return original content or throw an error
65+
// For now, returning original content to avoid breaking the file completely if AI fails.
66+
// A more robust solution might involve user feedback or retries.
6567
return { newContent: input.currentContent };
6668
}
6769
return output;
6870
}
6971
);
72+

0 commit comments

Comments
 (0)