Skip to content

Bazel installation in existing project failed. #31235

Closed

Description

@Eddygn

🐞 Bug report

Command (mark with an x)

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

Is this a regression?

Don't know.

Description

Attempt to migrate an existing project to Bazel fails during the migration.
Per the documentation here:
https://next.angular.io/guide/bazel

ng add @angular/bazel

🔬 Minimal Reproduction

Running ng add @angular/bazel
Or npm i
after bazel was added to the package list in the existing project.

🔥 Exception or Error





> ngc -p ./angular-metadata.tsconfig.json

node_modules/@angular/cdk/schematics/utils/html-head-element.d.ts(9,10): error TS2305: Module '"../../../../../../../../../edited_out_dir_name/node_modules/parse5/lib"' has no exported member 'DefaultTreeElement'.
node_modules/@angular/cdk/schematics/utils/parse5-element.d.ts(8,10): error TS2305: Module '"../../../../../../../../../edited_out_dir_name/node_modules/parse5/lib"' has no exported member 'DefaultTreeElement'.
node_modules/@angular/cdk/schematics/ng-update/html-parsing/elements.d.ts(8,10): error TS2305: Module '"../../../../../../../../../../edited_out_dir_name/node_modules/parse5/lib"' has no exported member 'DefaultTreeElement'.
node_modules/@angular/cdk/typings/schematics/utils/html-head-element.d.ts(9,10): error TS2305: Module '"../../../../../../../../../../edited_out_dir_name/node_modules/parse5/lib"' has no exported member 'DefaultTreeElement'.
node_modules/@angular/cdk/typings/schematics/utils/parse5-element.d.ts(8,10): error TS2305: Module '"../../../../../../../../../../edited_out_dir_name/node_modules/parse5/lib"' has no exported member 'DefaultTreeElement'.
node_modules/@angular/cdk/typings/schematics/ng-update/html-parsing/elements.d.ts(8,10): error TS2305: Module '"../../../../../../../../../../../edited_out_dir_name/node_modules/parse5/lib"' has no exported member 'DefaultTreeElement'.

npm ERR! code ELIFECYCLE
npm ERR! errno 1

🌍 Your Environment




Angular CLI: 8.1.0-beta.2
Node: 12.3.1
OS: win32 x64
Angular: 8.1.0-next.3
... animations, bazel, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.801.0-beta.2
@angular-devkit/build-angular      0.801.0-beta.2
@angular-devkit/build-optimizer    0.801.0-beta.2
@angular-devkit/build-webpack      0.801.0-beta.2
@angular-devkit/core               8.1.0-beta.2
@angular-devkit/schematics         8.0.3
@angular/cdk                       8.0.1
@angular/cli                       8.1.0-beta.2
@angular/http                      7.2.15
@angular/material                  8.0.1
@angular/material-moment-adapter   8.0.1
@bazel/bazel                       0.26.1
@bazel/ibazel                      0.10.3
@bazel/karma                       0.31.1
@bazel/typescript                  0.32.2
@ngtools/webpack                   8.1.0-beta.2
@schematics/angular                8.0.3
@schematics/update                 0.801.0-beta.2
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.34.0

Anything else relevant?

Seems like a schematics issue, but other schematics seem to work fine.

Activity

  1. Eddygn commented on Jun 22, 2019

    @Eddygn
    Author

    Adding parse5 as a dependency to the project worked as a workaround

  2. Eddygn commented on Jun 22, 2019

    @Eddygn
    Author

    Also to revert back from Bazel, renaming back the angular.json is not enough.
    There are also two files to delete:

    main.dev.ts
    main.prod.ts
    

    Otherwise building or serving fails with:

    ERROR in src/main.dev.ts(2,34): error TS2307: Cannot find module './app/app.module.ngfactory'.
    src/main.prod.ts(3,34): error TS2307: Cannot find module './app/app.module.ngfactory'.
    
  3. self-assigned this
    on Jun 24, 2019
  4. added
    area: bazelIssues related to the published `@angular/bazel` build rules
    on Jun 24, 2019
  5. added this to the needsTriage milestone on Jun 24, 2019
  6. added a commit that references this issue on Jun 25, 2019
    6bad2ca
  7. angular-automatic-lock-bot commented on Sep 15, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: bazelIssues related to the published `@angular/bazel` build rules

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions