Closed Zemnmez closed 1 month ago
I actually think this might be a bug in upstream parseJsonConfigFileContent
parseJsonConfigFileContent
OK I tried this on actual tsc
and it doesn't reject. looks like maybe somehow parseJsonConfigFileContent
is using an older version of the typescript
API
Appears to be because npm_typescript
is out of date:
thomas@DESKTOP-B82ERE8:~/monorepo/VERSION$ bazel run @npm_typescript//:tsc -- --version
INFO: Invocation ID: c7296e97-7565-4cf0-91d7-f10287e12f57
INFO: Analyzed target @@aspect_rules_ts~~ext~npm_typescript//:tsc (180 packages loaded, 5124 targets configured).
WARNING: /home/thomas/.cache/bazel/_bazel_thomas/19a58029a3d1c17a94df635d4e2b032e/external/aspect_rules_ts~~ext~npm_typescript/BUILD.bazel:32:17: input 'package' to @@aspect_rules_ts~~ext~npm_typescript//:.aspect_rules_js/node_modules/typescript is a directory; dependency checking of directories is unsound
INFO: Found 1 target...
Target @@aspect_rules_ts~~ext~npm_typescript//:tsc up-to-date:
dist/bin/external/aspect_rules_ts~~ext~npm_typescript/tsc.sh
INFO: Elapsed time: 1.406s, Critical Path: 0.29s
INFO: 8 processes: 7 internal, 1 local.
INFO: Build completed successfully, 8 total actions
INFO: Running command line: dist/bin/external/aspect_rules_ts~~ext~npm_typescript/tsc.sh --version
Version 5.3.3
Is it possible that options_validator
could use the workspace's local version?
Found the issue! I moved to MODULE.bazel and did not use ts_version_from = "//:package.json",
(it's not currently in the release docs) and as a result there had been drift between the typescript versions in my repo and that used by aspect_rules_ts
What happened?
In typescript 5.4, module preserve was added to better reflect code which a bundler would later compile.
I needed it to fix this grpc bug: https://github.com/grpc/grpc-node/issues/2617
Unfortunately, with
rules_ts
it fails options_validator:Version
Development (host) and target OS/architectures:
Output of
bazel --version
:bazel 7.1.1
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:bazel_dep(name = "aspect_rules_ts", version = "2.2.0")
Language(s) and/or frameworks involved:
typescript
How to reproduce
Any other information?
No response