Beta 32 AoT fails on Protractor typings
When trying to make an AoT/prod build with Beta 32 I run into the following error:
ERROR in Error encountered resolving symbol values statically. Could not resolve events relative to /Users//node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts., resolving symbol WebDriverCommand in /Users//node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users***/src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts
An issue has been made in the protractor repository about this. See: See: https://github.com/angular/protractor/issues/3375
It has something todo with Typescript 2.1
As a workaround I have removed protractor from the project for now. But this is of course not ideal.
OS?
Mac OSX
Versions.
@angular/cli: 1.0.0-beta.32.3 [1.0.0-beta.15] node: 6.9.5 os: darwin x64 @angular/common: 2.4.8 @angular/compiler: 2.4.8 @angular/core: 2.4.8 @angular/forms: 2.4.8 @angular/http: 2.4.8 @angular/platform-browser: 2.4.8 @angular/platform-browser-dynamic: 2.4.8 @angular/router: 3.4.8 @angular/cli: 1.0.0-beta.32.3 @angular/compiler-cli: 2.4.8
Repro steps.
ng build --prod --aot --env=dev --sm false --base-href="/app/"
I have exact same the problem. After hours of trying, I found the temporary solution is very simple. Downgrade the protractor version to v4.0.14 or earlier.
4.0.14 could be the trick indeed. I first trying to downgrade to version 5.0. But that caused another "ERROR in Error encountered resolving symbol values statically". Something with 'Runner'
I also have the same problem I'm trying use protractor version 5.0. This is my output when trying using v5.0:
ERROR in Error encountered resolving symbol values statically. Could not resolve events relative to /Users/username/project/node_modules/protractor/built/runner.d.ts., resolving symbol Runner in /Users/username/project/node_modules/protractor/built/runner.d.ts
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/username/project/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
and my current version of angular project: @angular/cli: 1.0.0-beta.32.3 [1.0.0-beta.25.5] node: 6.9.5 os: darwin x64 @angular/common: 2.4.8 @angular/compiler: 2.4.8 @angular/core: 2.4.8 @angular/flex-layout: 2.0.0-beta.5 @angular/forms: 2.4.8 @angular/http: 2.4.8 @angular/platform-browser: 2.4.8 @angular/platform-browser-dynamic: 2.4.8 @angular/router: 3.4.8 @angular/cli: 1.0.0-beta.32.3 @angular/compiler-cli: 2.4.8
However, the fresh new generated with "ng new" project doesn't face the same problem when using ng build --aot command and protractor version 5.1.0. Therefore, I have no ideas how to replicate the bug for reporting. Furthermore, despite my effort on keeping current project with new changes in angular-cli, the bug on ng build with Aot doesn't go away. In my opinion, Protractor v5 is currently unstable, and using version 4 is the best solution.
Also have the problem with protractor 5.1.0. Updated an existing project that ran before with beta.26.
Downgrading to protector 4.0.14 works, although there I have some problems with the webdriver-manager update command.
I just had a look at a new plain vanilla cli project where the aot build works even with protractor 5.1.0. After thinking about possible differences to my "older" project I stumbled upon the fact, that in the new cli project, e2e-specs are only in the "e2e" folder whereas in my project, I had some e2e specs in the "src" folder. So I moved all my e2e specs into the e2e folder and now it works just fine.
Fixed by https://github.com/angular/angular-cli/pull/4924
I can confirm this issue, and also that @eilensm 's solution fixed it for me.
I also had one .e2e.ts file leftover in my /src directory which caused the error. Moving that file to the /e2e folder fixed it for me.
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.