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

Cannot find package @wp-playground/wordpress-builds #2026

Closed
swissspidy opened this issue Nov 25, 2024 · 5 comments
Closed

Cannot find package @wp-playground/wordpress-builds #2026

swissspidy opened this issue Nov 25, 2024 · 5 comments
Labels
[Package][@wp-playground] Blueprints [Type] Bug An existing feature does not function as intended

Comments

@swissspidy
Copy link
Member

In my custom GitHub Action I am using Playground to run performance tests in CI.

Something now broke in the update of @wp-playground/cli from 1.0.12 to 1.0.13, as can be seen at swissspidy/wp-performance-action#213 (CI run: https://github.com/swissspidy/wp-performance-action/actions/runs/12010649165/job/33477942835?pr=213)

I am calling ./node_modules/@wp-playground/cli/wp-playground.js server directly and with 1.0.13 I get the following error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@wp-playground/wordpress-builds' imported from /home/runner/work/wp-performance-action/wp-performance-action/env/node_modules/@wp-playground/blueprints/index.js
    at packageResolve (node:internal/modules/esm/resolve:838:9)
    at moduleResolve (node:internal/modules/esm/resolve:907:18)
    at defaultResolve (node:internal/modules/esm/resolve:1037:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:582:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:241:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:132:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Any help appreciated.

@adamziel
Copy link
Collaborator

adamziel commented Nov 25, 2024

@swissspidy Thank you for reporting! It seems like @wp-playground/wordpress-builds is not picked up as a dependency when nx is producing the final package.json file. It's marked as private in the Playground repo – I wouldn't expect a production package to actually need it – I wonder what happened there.

As a temporary workaround until the underlying problem is solved, you can install that package manually – it's on npm.

@adamziel adamziel added [Type] Bug An existing feature does not function as intended [Package][@wp-playground] Blueprints labels Nov 25, 2024
@adamziel adamziel moved this from Inbox to Up next in Playground Board Nov 25, 2024
@adamziel
Copy link
Collaborator

Ah, #1987 created a dependency between the Blueprints package and the WordPress builds package. @bgrgicak let's pull the WordPress version details from https://api.wordpress.org/core/version-check/1.7/?channel=beta instead of using the version of the latest minified web build the web as a proxy for the latest WordPress version.

adamziel added a commit that referenced this issue Nov 25, 2024
… of assuming it's the same as the last minified build

      WordPress builds package, breaking `@wp-playground/cli` in #2026

This PR updates the setSiteLanguage step to pull the latest/bets WordPress version details from api.wordpress.org/core/version-check/1.7?channel=beta
instead of implicitly assuming the latest version is the same as that of
the latest minified web build. It reuses the Playground CLI
resolveWordPressRelease function, bringing us closer to having zero
CLI-specific logic.

 ## Testing instructions

* CI tests
* Run Playground CLI via `bun packages/playground/cli/src/cli.ts server`
  and confirm WordPress is still being downloaded without errors.
@adamziel
Copy link
Collaborator

Fix incoming in #2027

@adamziel adamziel moved this from Up next to In progress in Playground Board Nov 25, 2024
adamziel added a commit that referenced this issue Dec 1, 2024
… of assuming it's the same as the last minified build (#2027)

#1987 created a
dependency between the `@wp-playground/blueprints` package and the
`@wp-playground/wordpress-builds` package breaking `@wp-playground/cli`
– see #2026

This PR updates the setSiteLanguage step to pull the latest/best
WordPress version details from
api.wordpress.org/core/version-check/1.7?channel=beta instead of
implicitly assuming the latest version is the same as that of the latest
minified web build. It reuses the Playground CLI resolveWordPressRelease
function, bringing us closer to having zero CLI-specific logic.

## Follow-up work

Invent an ESLint rule to prevent further dependencies on
`@wp-playground/wordpress-builds`

 ## Testing instructions

* CI tests
* Run Playground CLI via `bun packages/playground/cli/src/cli.ts server`
and confirm WordPress is still being downloaded without errors.

cc @swissspidy @bgrgicak
@zaerl
Copy link
Collaborator

zaerl commented Dec 10, 2024

@adamziel #2027 is merged. Can we close this?

@swissspidy
Copy link
Member Author

From my perspective, yes. The latest version on npm now works for me. Thanks y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package][@wp-playground] Blueprints [Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

No branches or pull requests

3 participants