Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bazel): fix strict null checks compile error in packages/bazel/src/schematics/ng-add/index.ts #29282

Conversation

Projects
None yet
3 participants
@gregmagolan
Copy link
Contributor

commented Mar 13, 2019

Noticed this failure:

ERROR: /home/circleci/ng/packages/bazel/src/schematics/ng-add/BUILD.bazel:5:1: Compiling TypeScript (devmode) //packages/bazel/src/schematics/ng-add:ng-add failed (Exit 1): tsc_wrapped__bin failed: error executing command 
  (cd /home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/execroot/angular && \
  exec env - \
    BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \
    PATH=/bin:/usr/bin \
  bazel-out/host/bin/external/npm/node_modules/@bazel/typescript/tsc_wrapped__bin @@bazel-out/k8-fastbuild/bin/packages/bazel/src/schematics/ng-add/ng-add_es5_tsconfig.json)
Execution platform: //tools:rbe_ubuntu1604-angular
packages/bazel/src/schematics/ng-add/index.ts:84:30 - error TS2531: Object is possibly 'null'.

84     const gitIgnoreContent = host.read(gitignore).toString();
                                ~~~~~~~~~~~~~~~~~~~~
packages/bazel/src/schematics/ng-add/index.ts:105:30 - error TS2531: Object is possibly 'null'.

105     const workspaceContent = host.read(workspacePath).toString();
                                 ~~~~~~~~~~~~~~~~~~~~~~~~
packages/bazel/src/schematics/ng-add/index.ts:223:21 - error TS2531: Object is possibly 'null'.

223     const content = host.read(tsconfigPath).toString();
                        ~~~~~~~~~~~~~~~~~~~~~~~
packages/bazel/src/schematics/ng-add/index.ts:258:21 - error TS2531: Object is possibly 'null'.

258     const content = host.read(packageJson).toString();
                        ~~~~~~~~~~~~~~~~~~~~~~
packages/bazel/src/schematics/ng-add/index.ts:303:21 - error TS2531: Object is possibly 'null'.

303     const content = host.read(packageJson).toString();
                        ~~~~~~~~~~~~~~~~~~~~~~

in test_ivy_aot in #29197. Not sure why the strict null checks failure showed up in that PR but it is correct in that host.read() may return null.

@alexeagle Any chance strict null checks are behaving differently on RBE than in a local worker?

@gregmagolan gregmagolan requested a review from kyliau Mar 13, 2019

@gregmagolan gregmagolan requested a review from angular/tools-bazel as a code owner Mar 13, 2019

@googlebot googlebot added the cla: yes label Mar 13, 2019

@ngbot ngbot bot added this to the needsTriage milestone Mar 13, 2019

@kyliau

kyliau approved these changes Mar 13, 2019

@kara kara closed this in 9a7f560 Mar 13, 2019

wKoza added a commit to wKoza/angular that referenced this pull request Apr 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.