Hello.
I have a Typescript Express app using pnpm workspaces and some import aliases (under compilerOptions.path in tsconfig.json), like this:
{
"compilerOptions": {
"paths": {
"common/*": ["./common/*"],
"server/*": ["./server/*"],
"client/*": ["./client/*"],
},
}
}
Today, I use tsx, and invoke my "development mode" server like this:
"server": "tsx watch ./server/server.ts",
I've tried to do the same using oxc-node
"server": "node --import @oxc-node/core/register ./server/server.ts",
But I get import errors like:
node:internal/modules/run_main:123
triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'common' imported from <repo_path>/common/enums/feature-enums.ts
Did you mean to import "<file:///<repo_path>/common/Internationalisation/translation-map.json"?
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:266:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at nextResolve (node:internal/modules/esm/hooks:748:28)
at resolve (file:///<repo_path>/node_modules/.pnpm/@oxc-node+core@0.0.35/node_modules/@oxc-node/core/esm.mjs:16:10)
at nextResolve (node:internal/modules/esm/hooks:748:28)
at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
at handleMessage (node:internal/modules/esm/worker:199:24)
at Immediate.checkForMessages [as _onImmediate] (node:internal/modules/esm/worker:141:28) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v22.19.0
[nules/run_main:123](node:internal/modules/run_main:123)
triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'common' imported from <repo_path>/server/rootroutes/rootroutes.ts
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:266:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at nextResolve (node:internal/modules/esm/hooks:748:28)
at resolve (file:///<repo_path>/node_modules/.pnpm/@oxc-node+core@0.0.35/node_modules/@oxc-node/core/esm.mjs:16:10)
at nextResolve (node:internal/modules/esm/hooks:748:28)
at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
at handleMessage (node:internal/modules/esm/worker:199:24)
at Immediate.checkForMessages (node:internal/modules/esm/worker:141:28) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v22.19.0
Any pointers / tips? I wondered if it's a config issue (like oxc-node not detecting my tsconfig.json). If you need a "minimal reproduction" example, I can try to make one.
Thank you again for the great tool!
Hello.
I have a Typescript Express app using pnpm workspaces and some import aliases (under
compilerOptions.pathintsconfig.json), like this:Today, I use tsx, and invoke my "development mode" server like this:
I've tried to do the same using
oxc-nodeBut I get import errors like:
Any pointers / tips? I wondered if it's a config issue (like
oxc-nodenot detecting mytsconfig.json). If you need a "minimal reproduction" example, I can try to make one.Thank you again for the great tool!