question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot Generate Cypress Project on 13.10

See original GitHub issue

Current Behavior

Error generating cypress project. Getting error related to not being able to find the logger.

Expected Behavior

Be able to geenrate a cypress e2e project. This is the first time I’ve run this command.

Steps to Reproduce

Install @nrwl/cypress

yarn add --dev @nrwl/cypress yarn nx generate @nrwl/cypress:cypress-project <project>-e2e --project=<project>

package.json:

{
  "name": "<name>",
  "version": "0.0.0",
  "private": true,
  "workspaces": [
    "apps/*",
    "packages/*",
    "tools/*"
  ],
  "devDependencies": {
    "@babel/preset-env": "^7.16.11",
    "@babel/preset-react": "^7.16.7",
    "@codebrew/nx-aws-cdk": "^1.0.3",
    "@craco/craco": "7.0.0-alpha.3",
    "@nrwl/cli": "^13.10.0",
    "@nrwl/cypress": "^13.10.0",
    "@nrwl/eslint-plugin-nx": "13.9.7",
    "@nrwl/jest": "13.9.7",
    "@nrwl/linter": "13.9.7",
    "@nrwl/react": "^13.9.7",
    "@nrwl/web": "13.9.7",
    "@nrwl/workspace": "13.10.0",
    "@testing-library/dom": "^8.13.0",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "12.1.4",
    "@testing-library/react-hooks": "7.0.2",
    "@testing-library/user-event": "^13.5.0",
    "@tsconfig/node14": "^1.0.1",
    "@types/chance": "^1.1.3",
    "@types/graphql": "^14.5.0",
    "@types/jest": "27.0.2",
    "@types/node": "^17.0.23",
    "@types/react": "17.0.40",
    "@types/react-dom": "17.0.13",
    "@typescript-eslint/eslint-plugin": "~5.10.0",
    "@typescript-eslint/parser": "~5.10.0",
    "autoprefixer": "^10.4.4",
    "aws-sdk": "^2.1095.0",
    "babel-jest": "27.2.3",
    "babel-loader": "^8.2.4",
    "babel-webpack-plugin": "^0.1.2",
    "chalk": "^5.0.0",
    "chance": "^1.1.8",
    "craco-babel-loader": "^1.0.3",
    "cypress": "^9.1.0",
    "dotenv": "^16.0.0",
    "eslint": "^8.12.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-config-react-app": "^7.0.0",
    "eslint-plugin-": "nrwl/nx",
    "eslint-plugin-cdk": "^1.3.0",
    "eslint-plugin-cypress": "^2.10.3",
    "eslint-plugin-import": "2.25.4",
    "eslint-plugin-jsx-a11y": "6.5.1",
    "eslint-plugin-react": "7.29.3",
    "eslint-plugin-react-hooks": "4.3.0",
    "install-peerdeps": "^3.0.3",
    "jest": "27.2.3",
    "jest-console": "^0.1.0",
    "jest-junit": "^13.0.0",
    "jest-watch-typeahead": "^1.0.0",
    "mocha": "5.2.0",
    "mochawesome-report-generator": "^6.2.0",
    "nx": "^13.10.0",
    "postcss": "^8.4.12",
    "prettier": "^2.5.1",
    "react-scripts": "5",
    "react-test-renderer": "17.0.2",
    "ts-jest": "27.0.5",
    "typescript": "^4.6.3",
    "web-vitals": "^2.1.4",
    "webpack": "^5.72.0"
  },
  "engines": {
    "npm": ">=7.0.0",
    "node": ">=14.0.0"
  },
  "packageManager": "npm@8.5.0"
}

Failure Logs

Cannot find module 'nx/src/shared/logger'
Require stack:
- /Users/victor/dev/workspace/coquimono/node_modules/@nrwl/cypress/node_modules/@nrwl/devkit/index.js
- /Users/victor/dev/workspace/coquimono/node_modules/@nrwl/cypress/src/generators/cypress-project/cypress-project.js
- /Users/victor/dev/workspace/coquimono/node_modules/nx/src/config/workspaces.js
- /Users/victor/dev/workspace/coquimono/node_modules/nx/src/command-line/generate.js
- /Users/victor/dev/workspace/coquimono/node_modules/nx/src/command-line/nx-commands.js
- /Users/victor/dev/workspace/coquimono/node_modules/nx/bin/init-local.js
- /Users/victor/dev/workspace/coquimono/node_modules/nx/bin/nx.js

Environment

yarn run v1.22.18
$ /Users/victor/dev/workspace/coquimono/node_modules/.bin/nx report

 >  NX   Report complete - copy this into the issue template

   Node : 16.14.2
   OS   : darwin arm64
   yarn : 1.22.18
   
   nx : 13.10.0
   @nrwl/angular : Not Found
   @nrwl/cypress : 13.10.0
   @nrwl/detox : Not Found
   @nrwl/devkit : 13.10.0
   @nrwl/eslint-plugin-nx : 13.9.7
   @nrwl/express : Not Found
   @nrwl/jest : 13.9.7
   @nrwl/js : 13.10.0
   @nrwl/linter : 13.9.7
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 13.10.0
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 13.10.0
   @nrwl/web : 13.9.7
   @nrwl/workspace : 13.10.0
   typescript : 4.6.3
   rxjs : 6.6.7
   ---------------------------------------
   Community plugins:
   	 @codebrew/nx-aws-cdk: 1.0.3

Done in 0.64s.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vectorhackercommented, Apr 11, 2022

That’s great! Glad I could be of help.

1reaction
barbados-clemenscommented, Apr 11, 2022

typically the cypress project generator is called via other application generators which will always scaffold out a serve target. but in the case of a manual target then you’ll need to either pass in the baseUrl or a project with a serve target. in this case we aren’t null checking the project to make sure it has a serve target leading to the error.

I’ll update the cypress-project to null check the the project targets and print out an error message if one isn’t found so you don’t have this non discript error.

Thanks for finding the bug for us 😄

I’ll leave this issue open to reference in the PR to make sure we give people better error with unexpected projects 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog - Cypress Documentation
This change aligns with how the cy.visit() command generates urls with query ... your project uses a projectId that cannot be found in...
Read more >
Projects - Cypress Documentation
With Cypress, you have the ability to record your project's tests. ... Once you set up your project to record, we generate a...
Read more >
Troubleshooting | Cypress Documentation
Open Cypress via cypress open · Go to Developer Tools -> View App Data · This will take you to the directory in...
Read more >
Installing Cypress and writing your first test
Cypress will then launch and ask us to create our first spec since we don't ... Cypress is throwing an error and says...
Read more >
Command Line - Cypress Documentation
cypress run --record --key <record-key>. Record your test results to Cypress Cloud. For this option to work you must first set up your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found