Skip to content

Commit 953b708

Browse files
aadamsxclaude
andcommitted
fix: correct templates directory path for Next.js dev mode
Use process.cwd() relative path instead of __dirname which doesn't work correctly with Next.js turbopack compilation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 7817c52 commit 953b708

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/sim/app/api/workflows/[id]/export-service/generate-zip.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import JSZip from 'jszip'
99
* Read all template files from the templates directory.
1010
*/
1111
function loadTemplates(): Record<string, string> {
12-
const templatesDir = join(__dirname, 'templates')
12+
// Use process.cwd() for Next.js compatibility since __dirname is unreliable in dev mode
13+
// In monorepo, process.cwd() is the apps/sim directory
14+
const templatesDir = join(
15+
process.cwd(),
16+
'app/api/workflows/[id]/export-service/templates'
17+
)
1318
const templates: Record<string, string> = {}
1419

1520
function readDir(dir: string, prefix: string = '') {

0 commit comments

Comments
 (0)