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

Local Environment: wp-cli php fails to run a script #438

Closed
adamziel opened this issue May 24, 2023 · 0 comments · Fixed by #441
Closed

Local Environment: wp-cli php fails to run a script #438

adamziel opened this issue May 24, 2023 · 0 comments · Fixed by #441
Assignees
Labels
[Type] Bug An existing feature does not function as intended

Comments

@adamziel
Copy link
Collaborator

adamziel commented May 24, 2023

In wordpress-develop directory:

; wp-now php ./vendor/bin/phpunit
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:399:5)
    at validateString (node:internal/validators:163:11)
    at Object.join (node:path:1176:7)
    at runWordPressMode (file:///Users/cloudnik/.npm/_npx/48f1587babebd1f4/node_modules/@wp-now/wp-now/main.js:556:58)
    at async runWordPressDevelopMode (file:///Users/cloudnik/.npm/_npx/48f1587babebd1f4/node_modules/@wp-now/wp-now/main.js:542:3)
    at async file:///Users/cloudnik/.npm/_npx/48f1587babebd1f4/node_modules/@wp-now/wp-now/main.js:492:9
    at async applyToInstances (file:///Users/cloudnik/.npm/_npx/48f1587babebd1f4/node_modules/@wp-now/wp-now/main.js:437:5)
    at async startWPNow (file:///Users/cloudnik/.npm/_npx/48f1587babebd1f4/node_modules/@wp-now/wp-now/main.js:486:3)
    at async executePHPFile (file:///Users/cloudnik/.npm/_npx/48f1587babebd1f4/node_modules/@wp-now/wp-now/main.js:773:51)
    at async Object.handler (file:///Users/cloudnik/.npm/_npx/48f1587babebd1f4/node_modules/@wp-now/wp-now/main.js:890:9) {
  code: 'ERR_INVALID_ARG_TYPE'
}

It seems like it tries to run WordPress mode when I only expected to run a PHP file. cc @danielbachhuber

@adamziel adamziel added [Type] Bug An existing feature does not function as intended Local Environment labels May 24, 2023
@danielbachhuber danielbachhuber self-assigned this May 24, 2023
Pookie717 added a commit to Pookie717/wordpress-playground that referenced this issue Oct 1, 2023
Fixes WordPress/wordpress-playground#438

## What?

Removes the magic WordPress loading for the `wp-now php` command.

## Why?

It's not particularly intuitive that you get WordPress when you run
`wp-now php`. It's more intuitive that WordPress will load if you run
WP-CLI, so let's keep the behavior for that feature
(https://github.com/WordPress/wordpress-playground/issues/269).

## Testing Instructions

Tests should pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants