Angular-cli: failed to run ng serve with Bazel's opt-in preview on windows

Created on 23 Jun 2019  ·  6Comments  ·  Source: angular/angular-cli

🐞 Bug report

Command (mark with an x)


- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?


No, It's Bazel opt-in preview in Angualr CLI v8.x

Description

Following the blog post Try Bazel’s opt-in preview in Angular CLI. No problems on ng newng build, but failed on ng serve

🔬 Minimal Reproduction

on windows machine with no Bazel install.

  1. npm install -g @angular/bazel
  2. ng new ngBazel --collection=@angular/bazel
  3. cd ngBzel
  4. ng serve

🔥 Exception or Error

image

🌍 Your Environment





     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.0.3
Node: 10.15.0
OS: win32 x64
Angular: 8.0.2
... animations, bazel, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.3
@angular-devkit/build-angular     0.800.3
@angular-devkit/build-optimizer   0.800.3
@angular-devkit/build-webpack     0.800.3
@angular-devkit/core              8.0.3
@angular-devkit/schematics        8.0.3
@angular/cli                      8.0.3
@bazel/bazel                      0.26.1
@bazel/ibazel                     0.10.3
@bazel/karma                      0.31.1
@bazel/typescript                 0.31.1
@ngtools/webpack                  8.0.3
@schematics/angular               8.0.3
@schematics/update                0.800.3
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0

Anything else relevant?

Most helpful comment

Looks like it’s a problem with bazel version mismatches.

Try to globally install the same version of Bazel that is needed by your project.

```
npm I @bazel/[email protected] -g

All 6 comments

Afaik you need install bazel globally first time : npm i -g @bazel/bazel

See https://github.com/bazelbuild/bazel-watcher/issues/252

after npm i -g @bazel/bazel did fix original problem. but it leads another error

λ ng serve
Error getting Bazel info exit status 2
Querying for files to watch...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'query' from e:\practice\appbazel\.bazelrc:
  Inherited 'common' options: --experimental_allow_incremental_repository_updates
ERROR: Unrecognized option: --experimental_allow_incremental_repository_updates
Bazel query failed: exit status 2
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'query' from e:\practice\appbazel\.bazelrc:
  Inherited 'common' options: --experimental_allow_incremental_repository_updates
ERROR: Unrecognized option: --experimental_allow_incremental_repository_updates
Bazel query failed: exit status 2
Runing //src:devserver
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'query' from e:\practice\appbazel\.bazelrc:
  Inherited 'common' options: --experimental_allow_incremental_repository_updates
ERROR: Unrecognized option: --experimental_allow_incremental_repository_updates
Error running Bazel exit status 2
E:\practice\appBazel\node_modules\@bazel\ibazel\bin\windows_amd64\ibazel.exe failed with code 4.

Looks like it’s a problem with bazel version mismatches.

Try to globally install the same version of Bazel that is needed by your project.

```
npm I @bazel/[email protected] -g

thanks for all the helps.

I still got that error @chgc how can you fix it?
this is my devDependencies:

 "devDependencies": {
        "@angular/bazel": "angular/bazel-builds#8.0.0+762fc28",
        "@angular/cli": "8.0.1",
        "@angular/compiler": "8.0.0",
        "@angular/compiler-cli": "8.0.0",
        "@bazel/bazel": "^0.26.1",
        "@bazel/benchmark-runner": "0.1.0",
        "@bazel/buildifier": "0.25.1",
        "@bazel/ibazel": "0.10.3",
        "@bazel/karma": "~0.31.1",
        "@bazel/typescript": "~0.31.1",
        "@types/jasmine": "3.3.13",
        "@types/node": "6.14.6",
        "clang-format": "1.2.4",
        "core-js": "2.6.8",
        "firebase-tools": "7.0.0",
        "husky": "0.14.3",
        "protractor": "6.0.0",
        "ts-morph": "2.1.2",
        "typescript": "3.4.5"
    },

bazel version: Build label: 0.26.0
already try @bazel/[email protected] and @bazel/bazel@latest nothing work sir

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings