fix: write fallback package.json for codebase mode nsjail#8239
fix: write fallback package.json for codebase mode nsjail#8239rubenfiszel merged 2 commits intomainfrom
Conversation
…INVALID_PACKAGE_CONFIG Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Claude finished @rubenfiszel's task in 1m 4s —— View job PR Review: fix: write fallback package.json for codebase mode nsjail
ReviewLGTM — this is a clean, minimal fix for a real nsjail edge case. What the change does: When running codebase mode scripts under nsjail, no Code quality: The change follows the existing pattern at Logic correctness: Looking at the branch conditions at lines 1035-1045:
One minor note: condition 1 uses No concerns on security, performance, or correctness. The fallback Testing instructionsTo verify this fix, you need a Windmill instance with nsjail sandboxing enabled and a codebase mode TypeScript/JavaScript script. Create a codebase TAR (CJS or ESM) without a |
Deploying windmill with
|
| Latest commit: |
a573d9f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://458ebd77.windmill.pages.dev |
| Branch Preview URL: | https://esm-module-error.windmill.pages.dev |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ERR_INVALID_PACKAGE_CONFIGerror when running codebase mode scripts with nsjail sandboxingmandatory: falseand the source doesn't exist, it creates an empty 0-byte file at the destination. For codebase mode, nopackage.jsonwas written to the job directory, so nsjail created an empty/tmp/nodejs/package.jsonthat Node.js couldn't parse as JSON{}package.json for codebase mode before TAR extraction — if the codebase TAR includes its own package.json, extraction overwrites itTest plan
ERR_INVALID_PACKAGE_CONFIG)🤖 Generated with Claude Code