Giter Site home page Giter Site logo

Comments (8)

jelbourn avatar jelbourn commented on May 7, 2024

Okay, I can make this happen pretty consistently. Seems to happen when I bazel clean, build one ts_library, then build an unrelated ts_library

from angular-bazel-example.

jelbourn avatar jelbourn commented on May 7, 2024

Weirdly changing to ng_module seems to prevent this

from angular-bazel-example.

alexeagle avatar alexeagle commented on May 7, 2024

ts_library uses @build_bazel_rules_typescript//internal/tsc-wrapped as its compiler, and this should always have the flag --expose-gc passed to node.
https://github.com/bazelbuild/rules_typescript/blob/master/internal/tsc_wrapped/BUILD.bazel#L53

I think this is never working, and only once you have a ts worker where the cache has filled to some threshold, do we try to call the gc.

I don't see why ng_module would be any better, unless maybe you don't have
build --strategy=AngularTemplateCompile=worker so you're not using workers for ngc-wrapped?

from angular-bazel-example.

alexeagle avatar alexeagle commented on May 7, 2024

I tried to repro by checking for global.gc at the top-level of worker.ts, but it works for me. Let's debug it tomorrow.

from angular-bazel-example.

jelbourn avatar jelbourn commented on May 7, 2024

Resolved by updating

from angular-bazel-example.

alexeagle avatar alexeagle commented on May 7, 2024

Root cause here was that rules_nodejs had a breaking change, and so you need to use a recent rules_typescript.
But rules_nodejs is published as a bazel workspace dependency (since it bootstraps the bazel run @yarn//:yarn) and rules_typescript is published as a npm dependency.
Still, the ts_library rule could probably load a constant value from somewhere that gives the version of rules_nodejs and give a useful error message if the versions are skewed.

from angular-bazel-example.

alexeagle avatar alexeagle commented on May 7, 2024

Have a fix for this proposed, https://github.com/alexeagle/bazel_example_new

We still only pick up the top-level node_modules/@bazel/javascript though - so if you have @bazel/typescript depends on @bazel/[email protected] but you also installed @bazel/[email protected] we will end up using 1.0 even if that means rules_typescript doesn't work...

from angular-bazel-example.

alexeagle avatar alexeagle commented on May 7, 2024

rules_typescript now checks the version of rules_nodejs
https://github.com/bazelbuild/rules_typescript/blob/81114490287357c34f1e632c2e96abea611bf8ff/internal/ts_repositories.bzl#L47
so as long as we keep that up to date, it should solve this issue.

from angular-bazel-example.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.