Skip to content
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
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# ts-node reproductions

If you find a bug in ts-node and file an issue, it's helpful -- even necessary -- to create a minimal reproduction of the bug.
When you try to create new Array as spread from Set, you always getting empty array.

This link explains why we ask for a minimal reproduction. Thank you in advance!
https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d70ff

One way to do that is opening a pull-request on this repository with your reproduction. Github Actions will execute `./run.sh`.

You can put anything you want here: add/remove dependencies in `package.json`, change the commands in `run.sh`, change the code in `./example.ts`,
or add a hundred more `.ts` files.

Once your pull request is submitted here, link to it in your ts-node bug report.
To reproduce, just run npm start
17 changes: 16 additions & 1 deletion example.ts
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
console.log('Some .ts code reproducing a bug');
const a = [
'Row one',
'Row two',
];

const b = [
'Row three',
'Row four',
];

const set = [
...new Set([ ...a, ...b ])
];

// If you will see empty array - this is a bug
console.log(set);
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"dependencies": {
"ts-node": "latest",
"typescript": "latest"
"cross-env": "7.0.3",
"ts-node": "10.0.0"
},
"scripts": {
"start": "cross-env NODE_ENV=production node -r ts-node/register index.js"
}
}
4 changes: 2 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
n lts

# Install package.json dependencies
yarn
npm install

# Run ts-node
yarn ts-node ./example.ts
npm start

echo "Process exited with code: $?"
echo
Expand Down
5 changes: 5 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"allowJs": true
}
}