Closed Kyrodan closed 2 weeks ago
Hi Daniel,
thanks for reporting this issue! I am currently out of office with limited access to my work devices. I'd therefore recommend you downgrade cds-typer to version 0.27.0 for now. I will be back by next week and look into the matter asap.
Best, Daniel
Note to self: add a test for the build task to avoid xplatform issues in the future.
And now the interesting thing: the output of tsc shows unix/posix-style path separators. So i tried to convert the "this.task.dest" to posix-style separators (
this.task.dest.replaceAll("\\", "/")
): it works as expected.So it seems there is an incompatibility with Windows-Paths, quotes, the exec-method and the tsc command
I could reproduce the error. After many tries I came to the same conclusion of this being a bug with a mixture of Windows, shell quoting, tsc
and node's exec
function.
tsc
command works if executed manually in a shell.shell:true
, but this only is relevant for spawn
. exec
always runs in a shell, and shell:true
doesn't help here.The only fix I can add now is the proposed conversion of \
to /
in the path.
Is there an existing issue for this?
Nature of Your Project
TypeScript
Current Behavior
After updating cds-type to 0.28.0 and cds 8.x, executing
cds build
throws error:Expected Behavior
Does not throw error.
Steps To Reproduce
Just run
cds build
on a CAP-Project. It worked with an erlier version of cds-typer.Environment
Repository Containing a Minimal Reproducible Example
No response
Anything else?
Commit https://github.com/cap-js/cds-typer/commit/c58b8b6c8f78ac1275aba6136dc5035ca92323ef now double-quotes the outDir of tsc command. This leads to this issue. Removing the double quotes makes it work again. I also tried to replace the double-quotes with single-quotes: same behavior. Without double quotes and spaces in path names the issue is like in #330.
Running exactly the same command (with double-quotes) in cmd and powershell: everything works.
And now the interesting thing: the output of tsc shows unix/posix-style path separators. So i tried to convert the "this.task.dest" to posix-style separators (
this.task.dest.replaceAll("\\", "/")
): it works as expected.So it seems there is an incompatibility with Windows-Paths, quotes, the exec-method and the tsc command