-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress breaks webpack compiling when installed as an npm package #1227
Comments
Hmm, I don't see
We have been adding Cypress to Angular project without problems - see https://www.cypress.io/blog/2017/12/11/an-alternative-to-protractor-for-angular-projects/ for example |
@bahmutov Just to clarify to problem. The compilation errors are coming from application code not cypress test code, but these errors only occur after installing Cypress as an NPM package. I'm pretty sure this is because of some sub-dependencies that cypress installs for lodash typings which then force these on the application code. I'll list the errors below and walk through the application code. Here is 1 of the many stack trace errors - (they're all the same and all in component.ts files) ERROR in /Users/Josh/Documents/ui/src/app/accounts/account-details/account-details.component.ts (110,16): Property 'partyRoleName' does not exist on type '{}'. webpack: Failed to compile. here is the code causing the error - note partyRoleName private retrieveRoles() {
this.accountService.getPartyRoles(this.account.PartyID).subscribe(
partyRoles => {
_.map(partyRoles, (role) => {
role.partyRoleName = role.PartyRoleType.name;
});
this.Roles = partyRoles;
if (this.Roles.length > 0) {
this.retrievePrimaryContact();
_.each(this.Roles, (role) => {
role.owner = { party: new Party() };
this.accountService.getPartyRoleParentsByRelationshipTypeId(role.iD, 13).subscribe(
parents => {
if (parents.length) {
role.owner = parents[0];
role.owner.party.PartyName = parents[0].partyName;
}
}
);
this.retrieveShares(role);
this.retrieveRelations(role);
});
}
}
);
} We also define lodash at the top of the file For now I need to have my cypress folder to have its own package.json as a workaround but this is less than ideal - otherwise it breaks our projects dependencies |
Can you exclude the |
This is most definitely an issue. My build fails on first compile throwing type errors where lodash is used, only when cypress is installed via npm. *edit I was able to get this working. I added cypress to ignore in |
I updated using the command from the cypress test runner now I can't build components with same error above. :( |
Hi, is there any update to this issue? I have had similar issues as stated above with running Upon installation, Cypress adds |
For me, only deleting |
This is probably due to two things that combine to create the problem:
|
Potential fix: #3425 |
Released in |
Today happen to get the same error. But none of the above solution were relevant to me . |
Current behavior:
Currently when I install the cypress npm package on my angular cli project it breaks webpack compiling. The error only happens when after cypress is installed via npm and then
ng serve
is run to trigger webpack compiling.The repository itself has no trouble compiling pre-cypress or any other npm package
It seems related to lodash we define lodash as
Please see the stack trace down the bottom
Desired behavior:
cypress should not break webpack compiling
How to reproduce:
Create and Angular 4 project and try to compile is after cypress is installed as an npm package
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: