Skip to content

Commit 38a98e2

Browse files
committed
fix: Making it easy to run example with Node 20
ts-node + ESM + Node 20 has issues. This should fix the startup of the examples.
1 parent 18d175e commit 38a98e2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

example/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ async function run() {
1414
console.log("Optimization finished");
1515
}
1616

17-
run();
17+
run().catch((err) => {
18+
console.error(err);
19+
process.exit(1);
20+
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"build": "tsc --build",
1717
"lint": "eslint --ext .js,.ts .",
1818
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
19-
"dev": "ts-node-esm --experimental-specifier-resolution=node ./example/index.ts"
19+
"dev": "node --loader ts-node/esm --experimental-specifier-resolution=node ./example/index.ts"
2020
},
2121
"dependencies": {
2222
"@workadventure/tiled-map-type-guard": "^2.1.1",

0 commit comments

Comments
 (0)