Repository navigation
Closed
Labels
area: bazelIssues related to the published `@angular/bazel` build rulesIssues related to the published `@angular/bazel` build rules
Milestone
Description
🐞 bug report
Affected Package
The issue is caused by package @angular/bazel.
Is this a regression?
No, this never worked.
Description and Minimal Reproduction
The Bazel ng-new schematic doesn't seem to respect the less stylesheet format option.
I've followed the instructions on https://blog.angular.io/try-bazels-opt-in-preview-in-angular-cli-b9430bd00e82 to create a new Bazel project and selected less as my stylesheet format.
When trying to build the generated project, the build fails with the message:
index out of range (index is 0, but sequence has 0 elements) in sass_binary.
🔬 Minimal Reproduction
Create a new Bazel project by using the command:
ng new my-app --collection=@angular/bazel and choose the less stylesheet format option.
Then try to build the project by running ng build.
🔥 Exception or Error
ERROR: workspace_root/src/BUILD.bazel:12:9: Traceback (most recent call last):
File "workspace_root/src/BUILD.bazel", line 10
sass_binary(name = "global_stylesheet", src = ...], ...")
File "workspace_root/src/BUILD.bazel", line 12, in sass_binary
glob(["styles.css", "styles.scss"])[0]
index out of range (index is 0, but sequence has 0 elements)
ERROR: error loading package 'src': Package 'src' contains errors
🌍 Your Environment
Angular Version:
Angular CLI: 8.0.3
Node: 12.4.0
OS: darwin 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
Reacted by Hsuan Lee, Yadong Xie and Akihiko.KIgure
Metadata
Metadata
Assignees
Labels
area: bazelIssues related to the published `@angular/bazel` build rulesIssues related to the published `@angular/bazel` build rules
Activity
perjerz commentedon Jun 22, 2019
same issue
perjerz commentedon Jun 22, 2019
I has changed the project to css. The first build is fine.
However, I ran
ng serveI got the error message.
This error leads to bazelbuild/bazel-watcher#252
After that I ran
Then, I got this error.
I deleted my project and generated new app. I always get this error when I try to
ng buildTherefore, my guess is about build bazel rules are invalid after first build. I deleted all files in folder /private/var/tmp/_bazel_perjerz/, and run
ng buildagain. It works fine again.The second build takes ~9 seconds.
My problem is now about run ng serve which invoking ibazel to be run, and it totally break the bazel rules to be not found.
forssri commentedon Jun 23, 2019
I am facing similar issues, creating a new project using 8.0.3 angular and latest @angular/bazel and latest @bazel/bazel fails for both ng serve and ng build. This doesn't seem to be a failure related to LESS, tried with choosing either CSS/SASS while creating a new project as well
Analyzing: target //src:devserver (1 packages loaded, 0 targets configured) ERROR: /private/var/tmp/_bazel_sriram/67919b6f64079d0c1fa653a6ec12dcff/external/bazel_tools/tools/bash/runfiles/BUILD:1:1: in @build_bazel_rules_nodejs//internal/common:sources_aspect.bzl%sources_aspect aspect on sh_library rule @bazel_tools//tools/bash/runfiles:runfiles: Traceback (most recent call last): File "/private/var/tmp/_bazel_sriram/67919b6f64079d0c1fa653a6ec12dcff/external/bazel_tools/tools/bash/runfiles/BUILD", line 1 @build_bazel_rules_nodejs//internal/common:sources_aspect.bzl%sources_aspect(...) File "/private/var/tmp/_bazel_sriram/67919b6f64079d0c1fa653a6ec12dcff/external/build_bazel_rules_nodejs/internal/common/sources_aspect.bzl", line 40, in _sources_aspect_impl depset([f for f in target.files if f.pa...")], ...]) File "/private/var/tmp/_bazel_sriram/67919b6f64079d0c1fa653a6ec12dcff/external/build_bazel_rules_nodejs/internal/common/sources_aspect.bzl", line 41, in depset [f for f in target.files if f.path.endswith(".js")] type 'depset' is not iterable. Use theto_list()method to get a list. Use --incompatible_depset_is_not_iterable=false to temporarily disable this check.alan-agius4 commentedon Jun 24, 2019
Hi, at the moment bazel only supports CSS and SASS.
With regards to the users experiencing other errors, I suggest that a new issue is opening. Since the errors that you are experiencing are not related to the original issue.
Thanks.
gurezo commentedon Jun 24, 2019
henning96 commentedon Jun 24, 2019
Hi @alan-agius4,
I see. Is support for Less planned for the Angular 9 release? Or do we have to create our own Bazel rule for this?
alan-agius4 commentedon Jun 24, 2019
@henning96, probably we will have a first party rule for Less, but there is no timeframe yet.
alan-agius4 commentedon Jun 24, 2019
@gurezo, please file a new issue, your error is unrelated to Less.
gurezo commentedon Jun 24, 2019
@alan-agius4 Okay!
i'll making to new issue
fix(bazel): remove unsupported Css pre-processors from ng new (#31234)
manish-jain-1 commentedon Jul 9, 2019
Error getting Bazel info exit status 2
error setting higher file descriptor limit for this process: invalid argumentQuerying 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 /Users/user/ng8-bazel/bazeltest/.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 /Users/user/ng8-bazel/bazeltest/.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 /Users/user/ng8-bazel/bazeltest/.bazelrc:
Inherited 'common' options: --experimental_allow_incremental_repository_updates
ERROR: Unrecognized option: --experimental_allow_incremental_repository_updates
Error running Bazel exit status 2
/Users/user/ng8-bazel/bazeltest/node_modules/@bazel/ibazel/bin/darwin_amd64/ibazel failed with code 4.
angular-automatic-lock-bot commentedon Sep 15, 2019
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.