Skip to content

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

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

Conversation

gregmagolan
Copy link
Contributor

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 March 13, 2019 17:08
@gregmagolan gregmagolan requested a review from a team as a code owner March 13, 2019 17:08
@gregmagolan gregmagolan added the area: bazel Issues related to the published `@angular/bazel` build rules label Mar 13, 2019
@ngbot ngbot bot added this to the needsTriage milestone Mar 13, 2019
@gregmagolan gregmagolan added the target: major This PR is targeted for the next major release label Mar 13, 2019
@gregmagolan gregmagolan added the action: merge The PR is ready for merge by the caretaker label Mar 13, 2019
@kara kara closed this in 9a7f560 Mar 13, 2019
wKoza pushed a commit to wKoza/angular that referenced this pull request Apr 17, 2019
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: bazel Issues related to the published `@angular/bazel` build rules cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants