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 @php-wasm/web-service-worker #2086

Closed
swissspidy opened this issue Dec 16, 2024 · 4 comments · Fixed by #2087
Closed

Cannot find package @php-wasm/web-service-worker #2086

swissspidy opened this issue Dec 16, 2024 · 4 comments · Fixed by #2087
Labels
[Type] Bug An existing feature does not function as intended

Comments

@swissspidy
Copy link
Member

This is like #2026, but now with a different package, or specifically the src/utils folder of that package.

The exact error message is as follows:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/runner/work/wp-performance-action/wp-performance-action/env/node_modules/@php-wasm/web-service-worker/src/utils' imported from /home/runner/work/wp-performance-action/wp-performance-action/env/node_modules/@php-wasm/web-service-worker/src/index.js
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at moduleResolve (node:internal/modules/esm/resolve:932:10)
    at defaultResolve (node:internal/modules/esm/resolve:1056:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:654:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:603:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:586:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:242:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:135:49) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///home/runner/work/wp-performance-action/wp-performance-action/env/node_modules/@php-wasm/web-service-worker/src/utils'
}

Example: https://github.com/swissspidy/wp-performance-action/actions/runs/12352505018/job/34469680696

This happens when calling ./node_modules/@wp-playground/cli/wp-playground.js server directly.

This happens after upgrading @wp-playground/cli from 1.0.15 to 1.0.16

@adamziel adamziel moved this from Inbox to Bugs Backlog in Playground Board Dec 16, 2024
@adamziel adamziel added the [Type] Bug An existing feature does not function as intended label Dec 16, 2024
@adamziel
Copy link
Collaborator

Dang, thank you for reporting @swissspidy and I'm sorry you keep having that experience.

At first I thought I broke this in c6b4f4a by creating a dependency between @wp-playground/blueprints and @php-wasm/web-service-worker. The latter package is only built as ESModules and doesn't ship any commonjs files expected by Node.js.

One way to fix this would be to ship the commonsjs files also for that package. @wp-playground/cli is currently broken in node so there is some urgency here.

@psrpinto let me poke you to explore that CI job for using a local npm registry to verify whether the published Playground packages work. That would help resolve this entire class of issues before they affect the developers.

@psrpinto
Copy link
Member

Makes sense @adamziel, I will get on that once I complete #2053 (sorry, haven't found the time to dedicate to it recently).

@adamziel
Copy link
Collaborator

Thank you @psrpinto 🙏

@swissspidy
Copy link
Member Author

Thanks for the quick fix! 1.0.17 now works 🚀

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
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants