-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Protractor 6 TypeScript issue - compilation issue 6.0.0 #5192
Comments
Seems found typings in your project. Try to use them |
I can confirm the last error:
The folder
|
@sbley git source contains ts definitions, looks like excluded from package by .npmignore or something else. |
I created a pull request #5193 to add the typings as part of the prepublish task. |
Seems need also correct @types/selenium-webdriver or supply paths for TS module resolution |
You do not need @types/selenium-webdriver since it was removed from Protractor 6. As far as I know there are no versions that support version 4. There's an issue already discussing removing it locally once we publish our types to DefinitelyTyped. |
Hmmmm... okay looking at the PR, this is an issue. Thanks for the PR! I'll look into it when I get back from vacation. |
Just wanted to report I got the same issue. Can't even build our production build with @ngtools/webpack since it's somehow stumbles upon this d.ts file. Edit: turns out I include our spec files in the compilation process. That's how it was found. |
Yes. This is not working. I tried to get Protractor to work without publishing to DefinitelyTyped. I went on vacation after publishing. I'm sorry that I didn't notice this sooner. |
Root issue here is that I tried to roll out my own typings with the intent of releasing Protractor 6 without releasing types to DefinitelyTyped. After some experimentation, even if the types are in the node_modules/protractor/built/lib/selenium-webdriver directory with the tsconfig pointing to these files as "selenium-webdriver" typings, it still does not work. I'll have a PR for DefinitelyTyped/selenium-webdriver ready to go tomorrow and will also address some of these other issues. |
@cnishina Some protractor typings use direct import via 'selenium-webdriver/...' so types which does not declare this modules may not work. Moreover some code use relative import of typings via relative path './selenium-webdriver' |
Adding the typings during the prepublish task (PR above) solved my problem. I didn't have to point to the typings within tsconfig. |
@cnishina Look at selenium-webdrive4 folder *.d.ts files in original repo |
@sbley I could not get this to work in a sample project. I think the best bet is the DefinitelyTyped route. Also this is probably the right route without hacking in something to get it to work. Speaking of getting things to work, I tagged the latest Protractor to 5.4.2 since that version is pretty stable. @Delagen I did a word search and did not find these *.d.ts. files that reference the path './selenium-webdriver' |
@cnishina https://github.com/angular/protractor/blob/master/lib/ptor.ts#L5 for example of direct import based on library structure
For now issue can be temporary resolved by placing *.d.ts files from source in selenium-webdriver folder of installed npm package and placing something like this in tsconfig.json paths section
But I still cannot start protractor with Chrome 75 taking this:
|
@Delagen So let's table this for now. Julie and I discussed this today about modifying the tsconfig as a workaround. The conclusion we came up with is that the right thing to do is to release to DefinitelyTyped. So for this last portion (Chrome 75! You are from the future! 😄), could you open up a new bug about this? Also could you try the same issue with 5.4.2? Thanks! |
#5213 should resolve this. We will do another release at 6.0.0-beta.1 and wait to do a release when things appear stable. |
#5213 looks like a good approach to fix this. Pulling from @types/selenium-webdriver, as users of Protractor would, ensures that there are no surprises due to differing type definitions. I'm somewhat confused about the versioning though:
I would appreciate some clarification if Protractor 6.0.0 is the way to go for ordinary users of Protractor or if it's supposed to be a preview release only. About Protractor 5.4.2 and the future Chrome 75 or any other Chrome version after 73: It does not work. |
So here's some hindsight thoughts on release 6. I think I've written similar comments in other GitHub issue threads already: So I tried to release 6.0.0...6.0.0 was released and I was definitely disappointed that there were issues. There are a lot of changes internally that happened like removing q and selenium-webdriver control flow. The original plan was to use selenium-webdriver type definitions we created and do a release of Protractor before publishing them to DefinitelyTyped. When it was released, it did not work for our TypeScript community. So I put in a PR to DefinitelyTyped to publish selenium-webdriver 4 type definitions which relates to PR #5213 that you referenced. Since this did not work we set the latest (on npmjs) to 5.4.2 so if you were doing an Moving forward we will do beta releasesThe next version is 6.0.0-beta.1 for release. Should it be 6.0.1-beta.1 since 6.0.0 is sort of released? Version numbers are hard and I'll ask Julie what she thinks. The next release will be a beta version to work out the bugs. We will let the Angular core team to handle the official releases. Selenium-webdriver clientselenium-webdriver 4.0.0-alpha.1 has been out for over a year and they have not had release since. This appears to be stable. I do not think this is too risky which is why we are trying to get Protractor@6.x.x out the door. Limitations on Protractor@5.4.2I agree that version 5.4.2 does have limitations. Some of those limitations:
Some of the main motivations behind the work I've done for 6.x.x is to address the control flow deprecation, to update to a newer selenium-webdriver client and also address webdriver-manager limitations. I hope that helps. |
(I have not consulted server documentation as I write this.) As a consumer of packages I definitely assume that 6.0.0-beta.1 is a beta during development toward 6.0.0, not something happening after 6.0.0. |
Thanks @kylecordes. 6.0.1-beta.1 it is! |
I think there's a lot of context about Protractor 6 and the compilation issue. I'm going to lock this conversation so I can focus on fixing stuff. 😄 |
Bug report
11.12.0
6.0.0
Windows 10
The text was updated successfully, but these errors were encountered: