fix: preserve portable worker compatibility - #633
Conversation
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit 621f55e
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
| if ( | ||
| !processLike?.env || | ||
| !processLike.on || | ||
| !processLike.off || | ||
| !processLike.exit || | ||
| !cryptoLike?.randomUUID | ||
| ) { |
There was a problem hiding this comment.
Critical Bug: Validation requires process.off to exist, but the type system treats offSignal as optional.
The validation throws an error if processLike.off is undefined, breaking compatibility with environments where process.off() doesn't exist (like older Node.js versions or some runtime environments).
This contradicts:
- The optional type:
offSignal?: (signal: ProcessSignal, handler: ...) => void - The usage with optional chaining:
this.deps.offSignal?.(signal, this.signalHandler)at line 160 in ProcessPlatformAdapter
Fix: Remove the !processLike.off check from the validation:
if (
!processLike?.env ||
!processLike.on ||
!processLike.exit ||
!cryptoLike?.randomUUID
) {
throw new Error('Process runtime is not available');
}Then update line 41 to handle the missing method:
offSignal: processLike.off ? (signal, handler) => processLike.off?.(signal, handler) : undefined,| if ( | |
| !processLike?.env || | |
| !processLike.on || | |
| !processLike.off || | |
| !processLike.exit || | |
| !cryptoLike?.randomUUID | |
| ) { | |
| if ( | |
| !processLike?.env || | |
| !processLike.on || | |
| !processLike.exit || | |
| !cryptoLike?.randomUUID | |
| ) { | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-633.pgflow.pages.dev 📝 Details:
_Last updated: _ |

No description provided.