wxt-dev / wxt-dev/wxt

"module wxt not found" in GitHub Actions during yarn install

Open
#1,058 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

So my overall setup is Nx, Yarn Berry 4.5.0 and GitHub Actions for CI.

I've installed wxt and @wxt-dev/vue locally, as dev dependencies and on my PC everything works as expected.

In the CI however the yarn install command fails with

➤ YN0007: │ sharp@npm:0.33.5 must be built because it never has been before or the last one failed
  ➤ YN0007: │ @swc/core@npm:1.7.26 [da0cf] must be built because it never has been before or the last one failed
  ➤ YN0007: │ sharp@npm:0.32.6 must be built because it never has been before or the last one failed
  ➤ YN0007: │ better-sqlite3@npm:11.3.0 must be built because it never has been before or the last one failed
  ➤ YN0000: │ @my-workspace/extension@workspace:apps/browser-extension STDERR command not found: wxt
  ➤ YN0009: │ @my-workspace/extension@workspace:apps/browser-extension couldn't be built successfully (exit code 127, logs can be found here: /tmp/xfs-74[90](https://github.com/my-organization/my-workspace/actions/runs/11242673931/job/31277891170#step:13:94)8f99/build.log)

My first idea was to expose the contents of node_modules/.bin as ENV variables with

      - name: Set ENV variables to node binaries
        run: export PATH="$(yarn bin):$PATH"

But this doesn't make sense, as it fails during the install command and this would only run afterwards.
I guess it's mainly the prepare command that is called during install and immediately fails.

I've tried to install wxt globally as a backup solution, leading to another error

  [fail] Command failed after 13.4 s
  Error:  Cannot find package '@wxt-dev/module-vue' imported from /opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/core/resolve-config.mjs
    at packageResolve (node:internal/modules/esm/resolve:839:9)
    at moduleResolve (node:internal/modules/esm/resolve:908:18)
    at defaultResolve (node:internal/modules/esm/resolve:1038:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
    at onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:36)
    at TracingChannel.tracePromise (node:diagnostics_channel:337:14)
    at ModuleLoader.import (node:internal/modules/esm/loader:481:21)
    at defaultImportModuleDynamicallyForModule (node:internal/modules/esm/utils:214:31)
    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:253:12)
    at /opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/core/resolve-config.mjs:324:19
    at Array.map (<anonymous>)
    at resolveWxtUserModules (/opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/core/resolve-config.mjs:323:13)
    at resolveConfig (/opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/core/resolve-config.mjs:88:29)
    at async registerWxt (/opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/core/wxt.mjs:10:18)
    at async prepare (/opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/core/prepare.mjs:5:3)
    at async /opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/cli/commands.mjs:76:5
    at async CAC.<anonymous> (/opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/cli/cli-utils.mjs:16:22)
    at async /opt/hostedtoolcache/node/22.9.0/x64/lib/node_modules/wxt/dist/cli/index.mjs:11:1

Not sure if this is related to Yarn, but I'd appreciate any help.

Reproduction

Not easily reproducible

Steps to reproduce

No response

System Info
System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 1.73 GB / 15.77 GB
  Binaries:
    Node: 22.9.0 - ~\.nvm\versions\node\v22.9.0\bin\node.EXE
    Yarn: 4.5.0 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.19.4 - ~\Workspace\my-workspace\node_modules\.bin\npm.CMD
  npmPackages:
    vite: 5.4.8 => 5.4.8
    wxt: ^0.19.11 => 0.19.11
Used Package Manager

yarn

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GitHub Actions yarn install failure and the WXT entry points shown in dist/core/prepare.mjs and dist/core/resolve-config.mjs, focusing on how wxt and @wxt-dev/module-vue are resolved during installation. Compare the local and CI dependency environments; done means the install and prepare step complete successfully in CI without the missing-command or missing-package errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, node.js, typescript
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.