Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repro for node 20 worker thread errors not serialized correctly #33

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions consoleLogger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { setUncaughtExceptionCaptureCallback } from 'node:process'

setUncaughtExceptionCaptureCallback(console.error)
4 changes: 3 additions & 1 deletion example.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
console.log('Some .ts code reproducing a bug');
const a = (b: 1 | 2) => b + 1

console.log(a(3))
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"type": "module",
"dependencies": {
"ts-node": "latest",
"typescript": "latest"
Expand Down
19 changes: 14 additions & 5 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/usr/bin/env bash

# Install a specific version of node
n lts
# Run on Node 18
sudo n lts
yarn
yarn ts-node -vv
yarn node --experimental-loader ts-node/esm ./example.ts

# Install package.json dependencies
# Run on Node 20
sudo n 20
yarn
yarn ts-node -vv
yarn node --experimental-loader ts-node/esm ./example.ts

# Run ts-node
yarn ts-node ./example.ts
# Run on Node nightly
sudo n nightly
yarn
yarn ts-node -vv
yarn node --import=./consoleLogger.js --experimental-loader ts-node/esm ./example.ts

echo "Process exited with code: $?"
echo
Expand Down