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

I can't seem to generate a playwright e2e for my project #18652

Closed
1 of 4 tasks
sfabriece opened this issue Aug 16, 2023 · 4 comments
Closed
1 of 4 tasks

I can't seem to generate a playwright e2e for my project #18652

sfabriece opened this issue Aug 16, 2023 · 4 comments
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug

Comments

@sfabriece
Copy link

sfabriece commented Aug 16, 2023

Current Behavior

I cannot generate a playwright e2e project for my frontend

Expected Behavior

A playwright e2e configuration to be added to the frontend project

GitHub Repo

https://github.com/sfabriece/cypress-e2e-repro/tree/e2e

Steps to Reproduce

  1. Run yarn install
  2. Run nx g @nx/playwright:configuration --project=frontend --verbose
  3. See errors

Nx Report

Node   : 20.5.0
   OS     : darwin-arm64
   yarn   : 1.22.19
   
   nx (global)        : 16.7.0
   nx                 : 16.7.0
   @nx/js             : 16.7.0
   @nx/jest           : 16.7.0
   @nx/linter         : 16.7.0
   @nx/workspace      : 16.7.0
   @nx/angular        : 16.7.0
   @nx/cypress        : 16.7.0
   @nx/devkit         : 16.7.0
   @nx/eslint-plugin  : 16.7.0
   @nx/nest           : 16.7.0
   @nx/node           : 16.7.0
   @nx/playwright     : 16.7.0
   @nrwl/tao          : 16.7.0
   @nx/webpack        : 16.7.0
   typescript         : 5.1.6
   ---------------------------------------
   Community plugins:
   @ionic/angular : 7.2.2

Failure Logs

Could not format package.json. Error: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise"
Could not format nx.json. Error: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise"
Could not format tsconfig.base.json. Error: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise"
Could not format .vscode/extensions.json. Error: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise"
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise
    at new NodeError (node:internal/errors:405:5)
    at Function.from (node:buffer:324:9)
    at FsTree.write (/Users/xxxx/github/test/cypress-e2e-repro/node_modules/nx/src/generators/tree.js:63:33)
    at /Users/xxxx/github/test/cypress-e2e-repro/node_modules/@nx/devkit/src/generators/format-files.js:40:22
    at Generator.next (<anonymous>)
    at fulfilled (/Users/xxxx/github/test/cypress-e2e-repro/node_modules/tslib/tslib.js:166:62)
Could not format apps/frontend/project.json. Error: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise"
Could not format apps/frontend/.eslintrc.json. Error: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise"
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise
    at new NodeError (node:internal/errors:405:5)
    at Function.from (node:buffer:324:9)
    at FsTree.write (/Users/xxxx/github/test/cypress-e2e-repro/node_modules/nx/src/generators/tree.js:63:33)
    at /Users/xxxx/github/test/cypress-e2e-repro/node_modules/@nx/devkit/src/generators/format-files.js:40:22
    at Generator.next (<anonymous>)
    at fulfilled (/Users/xxxx/github/test/cypress-e2e-repro/node_modules/tslib/tslib.js:166:62)
UPDATE package.json
UPDATE .vscode/extensions.json
CREATE apps/frontend/e2e/example.spec.ts
CREATE apps/frontend/playwright.config.ts
UPDATE apps/frontend/project.json
UPDATE nx.json
UPDATE apps/frontend/.eslintrc.json
UPDATE tsconfig.base.json
Resolving classic to a url...
Downloading https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js...
Saving it into /Users/xxxx/github/test/cypress-e2e-repro/.yarn/releases/yarn-1.22.19.cjs...
Updating /Users/xxxx/github/test/cypress-e2e-repro/.yarnrc...
error An unexpected error occurred: "Cannot create property 'yarn-path' on string 'strict-peer-dependencies=false auto-install-peers=true save-exact=true'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/xxxx/github/test/cypress-e2e-repro/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/policies for documentation about this command.

 >  NX   Command failed: yarn set version classic


Error: Command failed: yarn set version classic
    at checkExecSyncError (node:child_process:887:11)
    at execSync (node:child_process:959:15)
    at installPackagesTask (/Users/xxxx/github/test/cypress-e2e-repro/node_modules/@nx/devkit/src/tasks/install-packages-task.js:33:42)
    at /Users/xxxx/github/test/cypress-e2e-repro/node_modules/@nx/devkit/src/utils/package-json.js:116:61
    at /Users/xxxx/github/test/cypress-e2e-repro/node_modules/@nx/devkit/src/generators/run-tasks-in-serial.js:13:19
    at Generator.next (<anonymous>)
    at /Users/xxxx/github/test/cypress-e2e-repro/node_modules/tslib/tslib.js:169:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/Users/xxxx/github/test/cypress-e2e-repro/node_modules/tslib/tslib.js:165:16)

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

It seems like a local version of yarn is installed in local directory in the process.

@sfabriece sfabriece changed the title I can seem to generate a playwright e2e for my project I can't seem to generate a playwright e2e for my project Aug 16, 2023
@FrozenPandaz FrozenPandaz added the scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx label Aug 16, 2023
@barbados-clemens
Copy link
Contributor

hi @sfabriece, I looked into this and it's not an issue with @nx/playwright, but with Nx not supporting prettier v3 yet.

You can down level to latest v2 of prettier until Nx supports it in the next release as the PR was merged not too long ago.
#18644

@sfabriece
Copy link
Author

@barbados-clemens are we talking about the next minor or patch release?

@barbados-clemens
Copy link
Contributor

@sfabriece nx v16.7.3 should contain the fixes to allow you to generate a playwright config now.

there is an issue with nx format that should be resolved with #18672

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants