❯ pnpm run schema
> @libreservice/[email protected] schema /mnt/4T/coll-last/open-source/my_rime
> node --loader ts-node/esm scripts/install_schemas.ts
(node:206029) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/process/esm_loader:34
internalBinding('errors').triggerUncaughtException(
^
[Object: null prototype] {
[Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]]
}
Node.js v21.2.0
ELIFECYCLE Command failed with exit code 1.
commit 1c376ce5e300f144b049857feed111037a69bc63
Author: Zhai Can <[email protected]>
Date: Thu Nov 23 21:57:13 2023 +0800
fix `pnpm run schemas` error with node 20+
diff --git a/tsconfig.json b/tsconfig.json
index a640dc7..5644228 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -14,5 +14,10 @@
"noEmit": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
- "references": [{ "path": "./tsconfig.node.json" }]
+ "references": [{ "path": "./tsconfig.node.json" }],
+ "ts-node": {
+ "experimentalSpecifierResolution": "node",
+ "transpileOnly": true,
+ "esm": true
+ }
}
I'm not sure if this can be considered as a proper fix, so just filed an issue instead of a PR :).