Implement new iframe preview system

This commit is contained in:
Alex Gleason committed 2025-07-20 14:07:48 -05:00
1 parent 245e424c3a
commit 5b2f6e1938
2 files changed
+129 -49

No files matched your search

+6 -1
View File
@@ -199,7 +199,12 @@ export default defineConfig({
async readFile(projectId: string, filePath: string): Promise<string> {
const fullPath = `${this.dir}/${projectId}/${filePath}`;
try {
return await this.fs.promises.readFile(fullPath, 'utf8');
const stat = await this.fs.promises.stat(fullPath);
if (stat.isFile()) {
return await this.fs.promises.readFile(fullPath, 'utf8');
} else {
throw new Error(`Path is not a file: ${filePath}`);
}
} catch (error) {
const fsError = error as NodeJS.ErrnoException;
if (fsError.code === 'ENOENT') {