Skip to content

ibazel failing to restart JS application with heavy external dependencies #825

Description

@markovejnovic

Describe the bug

Hey folks! I'm evaluating the use of ibazel with our monorepo and stumbled onto a relatively nasty bug where ibazel would fail to restart my relatively large JS application.

Reproduction instructions

https://github.com/markovejnovic/ibazel-js-repro

git clone https://github.com/markovejnovic/ibazel-js-repro.git
cd ibazel-js-repro
ibazel run //:dev
# wait until it prints 'hello world'
# edit src/main.ts to print a different string
# note ibazel doesn't catch it

Expected behavior

Ibazel restarts my target after a source file changes.

Actual behavior

Ibazel doesn't restart my target.

Version (please complete the following information):

  • OS: macOS
  • ibazel Version: iBazel - Version 0.29.0, present on HEAD
  • Bazel version: 9.1.0

Additional context

I think the bug is in ibazel.go:650. When labelsToWatch filters for labels that should be watched, it has special handling for localRepositories. aspect's external targets start with @ and are referenced as localRepositories, which means that we hit the break in ibazel.go:650.

To be 100% honest, I don't really understand the intent behind this function and this was discovered by getting claude to sprinkle debug statements across the program, so I might be wrong in my guess, but changing the break to a continue does populate the toWatch list as I would expect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions