The @deepkit/type-compiler installation mutations Typescript's tsc.js and typescript.js files (perhaps other as well?).
On Windows (when installing with pnpm), part of the injected code looks like this:
try {
typeTransformer = require('@deepkit/type-compiler');
} catch (error) {
typeTransformer = require('..\..\..\..\@deepkit+type-compiler@1.0.1-alpha.75_typescript@4.7.4\node_modules\@deepkit\type-compiler\dist\cjs');
}
Corresponding to the source: https://github.com/deepkit/deepkit-framework/blob/c1d6c415199804d966ce17ceb235a050de011da3/packages/type-compiler/install-transformer.ts#L23-L27
The \ path delimiters are not escaped in the path-string in the catch block, resulting in an invalid path.
This can be resolved by either escaping those characters (making them \\) or by using POSIX path delimiters (/), which are what Node expects anyway, even on Windows.
This issue would make deepkit impossible to use with tsc in cases where that try-block require doesn't work, though I'm not sure what scenarios could cause that to happen.
The
@deepkit/type-compilerinstallation mutations Typescript'stsc.jsandtypescript.jsfiles (perhaps other as well?).On Windows (when installing with
pnpm), part of the injected code looks like this:Corresponding to the source: https://github.com/deepkit/deepkit-framework/blob/c1d6c415199804d966ce17ceb235a050de011da3/packages/type-compiler/install-transformer.ts#L23-L27
The
\path delimiters are not escaped in the path-string in thecatchblock, resulting in an invalid path.This can be resolved by either escaping those characters (making them
\\) or by using POSIX path delimiters (/), which are what Node expects anyway, even on Windows.This issue would make deepkit impossible to use with
tscin cases where thattry-blockrequiredoesn't work, though I'm not sure what scenarios could cause that to happen.