You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm on Windows (Powershell) and I'm using tsx. When I run ./bin/dev.cmd before compiling the source code, it doesn't load any command from the src directory. Looking at the debug log, it isn't able to register tsx due to the following error:
oclif:config:ts-path Determining path for D:\PROJECT_PATH\dist\commands +1ms
oclif:config:ts-path registering tsx at D:\PROJECT_PATH +2ms
oclif:config:ts-path tsx path: D:\PROJECT_PATH\node_modules\tsx\dist\esm\api\index.cjs +0ms
oclif:config:ts-path Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
oclif:config:ts-path at new NodeError (node:internal/errors:405:5)
oclif:config:ts-path at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:149:11)
oclif:config:ts-path at defaultLoad (node:internal/modules/esm/load:99:3)
oclif:config:ts-path at nextLoad (node:internal/modules/esm/hooks:864:28)
oclif:config:ts-path at load (file:///D:/PROJECT_PATH/node_modules/tsx/dist/esm/index.mjs?1723992192336:2:1768)
oclif:config:ts-path at nextLoad (node:internal/modules/esm/hooks:864:28)
oclif:config:ts-path at Hooks.load (node:internal/modules/esm/hooks:447:26)
oclif:config:ts-path at handleMessage (node:internal/modules/esm/worker:196:24)
oclif:config:ts-path at Immediate.checkForMessages (node:internal/modules/esm/worker:138:28)
oclif:config:ts-path at process.processImmediate (node:internal/timers:476:21) +3ms
oclif:config:ts-path Could not find tsx. Skipping tsx registration for D:\PROJECT_PATH. +1ms
I tested with both a global tsx installation and a project one and I got the same error (with different tsxPath obv).
I manually added "file://" to this line before tsxPath and at this point it's able to correctly register tsx, but still it doesn't load the commands from the source folder even if the development flag is set to true when I call the execute function. Do I have to change the commands path in the package.json as well?
Scroll up in the logs (be aware that I see the error posted above because I added a new debug line in the catch block to print the full error after the following line)
debug(`Could not find tsx. Skipping tsx registration for ${root}.`)
Expected behavior
Firstly I expect tsx to be registered correctly on Windows as well, and secondly I expect ./bin/dev.cmd to load the commands from the src directory instead of the dist directory.
Environment (please complete the following information):
Describe the bug
I'm on Windows (Powershell) and I'm using
tsx
. When I run./bin/dev.cmd
before compiling the source code, it doesn't load any command from thesrc
directory. Looking at the debug log, it isn't able to registertsx
due to the following error:I tested with both a global
tsx
installation and a project one and I got the same error (with differenttsxPath
obv).I manually added
"file://"
to this line beforetsxPath
and at this point it's able to correctly registertsx
, but still it doesn't load the commands from the source folder even if thedevelopment
flag is set to true when I call the execute function. Do I have to change the commands path in the package.json as well?core/src/config/ts-path.ts
Line 88 in 2902ef3
To Reproduce
Steps to reproduce the behavior:
set DEBUG=*
tsx
instead ofts-node
in./bin/dev.cmd
./bin/dev.cmd
core/src/config/ts-path.ts
Line 92 in 2902ef3
Expected behavior
Firstly I expect
tsx
to be registered correctly on Windows as well, and secondly I expect./bin/dev.cmd
to load the commands from thesrc
directory instead of thedist
directory.Environment (please complete the following information):
Additional details
Refers #966
The text was updated successfully, but these errors were encountered: