rules_nodejs icon indicating copy to clipboard operation
rules_nodejs copied to clipboard

ts_library does not work --incremental option (TS 3.5.2)

Open siberex opened this issue 6 years ago • 7 comments

🐞 bug report

Affected Rule

The issue is caused by the rule: ts_library

Is this a regression?

No

Description

Failing to compile ts files when using Typescript 3.5.2

🔬 Minimal Reproduction

Use this repo to reproduce: https://github.com/siberex/bazel-issue-rules_nodejs_typescript_latest_option_incremental

cd /tmp
git clone [email protected]:siberex/bazel-issue-rules_nodejs_typescript_latest_option_incremental.git
cd bazel-issue-rules_nodejs_typescript_latest_option_incremental
bazel run //:bin

🔥 Exception or Error


error TS5074: Option '--incremental' can only be specified using tsconfig, emitting to single file or when option `--tsBuildInfoFile` is specified.

🌍 Your Environment

Operating System:

  
darwin
  

Output of bazel version:

  
0.27.1
  

Rules version (SHA):

  
0.32.2 (6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4)
  

Anything else relevant?

siberex avatar Jul 05 '19 04:07 siberex

I don't think the incremental is or will be supported by TS under bazel since bazel does it's own incrimental stuff

Toxicable avatar Jul 05 '19 04:07 Toxicable

Yes, but I wonder why it works with typescript 3.4.5, but not with 3.5.2 (same config)

siberex avatar Jul 05 '19 04:07 siberex

This is probably blocked on us upgrading google-internal to TS 3.5

alexeagle avatar Jul 09 '19 23:07 alexeagle

@siberex Does it work when you remove the incremental flag?

Toxicable avatar Jul 09 '19 23:07 Toxicable

Does it work when you remove the incremental flag?

yes, it works with TS 3.5.2 with incremental removed from tsconfig

siberex avatar Jul 09 '19 23:07 siberex

Then I think that's the correct behaviour, since the TS compilers incremental would probably conflict with bazels own incremental compiling. But maybe it should be documented why it's like this.

Toxicable avatar Aug 10 '19 20:08 Toxicable

Note, one possible "escape hatch" is to use plain tsc rather than ts_library, see https://github.com/bazelbuild/rules_nodejs/blob/master/packages/typescript/docs/install.md#alternatives

alexeagle avatar Oct 08 '19 14:10 alexeagle

No longer in scope for rules_nodejs which only supplies the Node.js toolchain as of v6.0.0.

Downstream canonical JavaScript + Node.js ruleset is now https://github.com/aspect-build/rules_js.

gregmagolan avatar Jun 08 '24 21:06 gregmagolan