Windows: SDK build generates backslash paths causing `dev --once` upload and `app:install` failures
#22,539 opened on 2026年7月4日
Repository metrics
- Stars
- (45,808 stars)
- PR merge metrics
- (平均マージ 1d 8h) (30d で 907 merged PRs)
説明
Description
The Twenty SDK generates Windows backslash paths (\) in the manifest and upload payloads when running on Windows. This causes two failures:
-
yarn twenty dev --once— All file uploads fail with:filePath contains unsafe characters or path traversal -
yarn twenty app:install— Installation fails with:File not found in package: src\logic-functions\render-template.logic-function.mjs(The tarball contains forward-slash paths, but the server's stored manifest has backslash paths from the initial install.)
Root Cause
Multiple locations in the SDK use path.join() and path.relative() to construct file paths. On Windows, these Node.js functions produce backslash-separated paths. These paths are then sent to the server as-is, where they fail validation.
Affected locations in node_modules/twenty-sdk/dist/:
-
login-rU5te3B6.mjs(the main CLI bundle):KNfunction (~line 60095):path.relative()producesbuiltPathwith backslashesAFfunction (~line 62404):path.join()producesbuiltPathwith backslasheskFfunction (~line 62391):path.join()producesbuiltPathwith backslashesBIfunction (~line 63327):path.relative()reconverts forward slashes back to backslashes when matching manifest entriesMR.uploadFile()(~line 65189):path.relative()producesbuiltHandlerPathwith backslashesyL.uploadFile()(~line 64259): sendsbuiltHandlerPathto theUploadApplicationFileGraphQL mutation — server rejects it
-
Manifest generation (~line 63078-63079):
sourceHandlerPathandbuiltHandlerPathuse rawpath.relative()output (backslashes on Windows) -
Front component paths (~line 63108-63109): Same issue with
sourceComponentPathandbuiltComponentPath
Steps to Reproduce
- On Windows, create a Twenty app with logic functions and front components
- Run
yarn twenty dev --once -r <remote> . - Observe all file uploads fail with "filePath contains unsafe characters or path traversal"
- Alternatively, run
yarn twenty app:publish --private -r <remote> .followed byyarn twenty app:install -r <remote> . - Install fails with "File not found in package: src\logic-functions..."
Suggested Fix
Normalize all paths to forward slashes (/) before sending to the server or including in the manifest. For example:
// Before
builtHandlerPath: r.replace(/\.tsx?$/, ".mjs")
// After
builtHandlerPath: r.replace(/\.tsx?$/, ".mjs").replace(/\/g, '/')
Apply this normalization at every point where paths are constructed for server communication or manifest storage:
KNfunction: normalizebuiltPathandsourcePathAFfunction: normalizebuiltPathkFfunction: normalizebuiltPathBIfunction: normalize thepath.relative()resultMR.uploadFile(): normalizebuiltHandlerPath- Manifest generation: normalize
sourceHandlerPath,builtHandlerPath,sourceComponentPath,builtComponentPath
Environment
- OS: Windows 11
- Node: v24.13.0
- Twenty SDK: 2.16.0
- Twenty Server: 2.17.0 (Docker)
- Package manager: Yarn 4.9.2
Workaround
Currently no clean workaround exists on Windows. The SDK works on macOS/Linux where path.join() and path.relative() use forward slashes natively.