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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel installation in existing project failed. #31235

Closed
Eddygn opened this issue Jun 21, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@Eddygn
Copy link

commented Jun 21, 2019

馃悶 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.

@Eddygn

This comment has been minimized.

Copy link
Author

commented Jun 22, 2019

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

@Eddygn

This comment has been minimized.

Copy link
Author

commented Jun 22, 2019

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'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.