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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder is broken when using angular-cli ^8.0.0 #10

Open
alantreadway opened this issue May 30, 2019 · 4 comments
Open

Builder is broken when using angular-cli ^8.0.0 #10

alantreadway opened this issue May 30, 2019 · 4 comments

Comments

@alantreadway
Copy link

alantreadway commented May 30, 2019

Step to reproduce:

  • Setup a project as described in the README.md.
  • Run ng e2e.

Expected behaviour:

  • Project builds and Cypress tests are executed.

Actual behaviour:

  • Command fails immediately with:
Could not find the implementation for builder ngx-cypress-builder:cypress
Error: Could not find the implementation for builder ngx-cypress-builder:cypress
    at WorkspaceNodeModulesArchitectHost.resolveBuilder (/Users/alan/git/ralloo/ralloo-api-ui/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:49:19)
    at E2eCommand.initialize (/Users/alan/git/ralloo/ralloo-api-ui/node_modules/@angular/cli/models/architect-command.js:135:55)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

After a little hacking around (to determine if this would be a quick fix or something bigger), I found that Angular CLI is now looking for an implementation field rather than a class field for the command defined in builders.json; after hacking my local npx-cypress-builder package to switch this, I was then seeing this error:

Builder is not a builder
Error: Builder is not a builder
    at WorkspaceNodeModulesArchitectHost.loadBuilder (/Users/alan/git/ralloo/ralloo-api-ui/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:84:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

...which led me to conclude this is likely to require a non-trivial fix. I couldn't quickly find any documentation on the Angular site about what the new expected interface contracts are.

Workaround:

  • I added some package.json scripts to mimic the behaviour of this package, using wait-on and npm-run-all dev dependencies in the interim until a fix can be made:
    "e2e": "run-p -r e2e:serve e2e:run",
    "e2e:edit": "run-p -r e2e:serve e2e:cypress-open",
    "e2e:run": "wait-on http://localhost:4200 && cypress run",
    "e2e:cypress-open": "wait-on http://localhost:4200 && cypress open",
    "e2e:serve": "ng serve -c e2e"
@isaacplmann
Copy link
Owner

I recommend using nrwl's cypress builder. The most recent version should work with angular 8. And is being actively maintained.

npm i @nrwl/builders

And use the builder: @nrwl/cypress:cypress in your angular.json.

Docs for builder options are here: https://nx.dev/api/cypress/builders/cypress

@niallconaghan
Copy link

I recommend using nrwl's cypress builder. The most recent version should work with angular 8. And is being actively maintained.

npm i @nrwl/builders

And use the builder: @nrwl/cypress:cypress in your angular.json.

Docs for builder options are here: https://nx.dev/api/cypress/builders/cypress

Cool, though out of interest, will you be updating this to support Angular 8 at anytime?

@isaacplmann
Copy link
Owner

isaacplmann commented Jun 5, 2019 via email

@mikesimmonds
Copy link

Please could you update the readme too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants