wxt-dev / wxt-dev/wxt

yarn install fails on a fresh initialization on MacOS

Open
#1,533 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

This bug affects yarn only. I have tested with NPM with everything else being the same and it works fine.

Error log

───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /private/var/folders/3l/b3zbvc0j7jlcf_jfpbl_9_540000gn/T/xfs-c0a05636/build.log
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ # This file contains the result of Yarn building a package (wxt-react-starter@workspace:.)
   2   │ # Script name: postinstall
   3   │ 
   4   │ 
   5   │ WXT 0.19.29
   6   │ ✖ Command failed after 15 ms
   7   │ 
   8   │  ERROR  Cannot find package '@wxt-dev/module-react' imported from /Users/brandondavis/github.com/instant-events/index.js
   9   │ 
  10   │     at __node_internal_ (/Users/brandondavis/.yarn/berry/cache/import-meta-resolve-npm-4.1.0-6e93749986-10c0.zip/node_modules/import-meta-resolve/lib/errors.js:4
       │ 36:11)
  11   │     at new NodeError (/Users/brandondavis/.yarn/berry/cache/import-meta-resolve-npm-4.1.0-6e93749986-10c0.zip/node_modules/import-meta-resolve/lib/errors.js:380:
       │ 5)
  12   │     at packageResolve (/Users/brandondavis/.yarn/berry/cache/import-meta-resolve-npm-4.1.0-6e93749986-10c0.zip/node_modules/import-meta-resolve/lib/resolve.js:10
       │ 35:9)
  13   │     at moduleResolve (/Users/brandondavis/.yarn/berry/cache/import-meta-resolve-npm-4.1.0-6e93749986-10c0.zip/node_modules/import-meta-resolve/lib/resolve.js:111
       │ 3:18)
  14   │     at defaultResolve (/Users/brandondavis/.yarn/berry/cache/import-meta-resolve-npm-4.1.0-6e93749986-10c0.zip/node_modules/import-meta-resolve/lib/resolve.js:12
       │ 89:15)
  15   │     at resolve (/Users/brandondavis/.yarn/berry/cache/import-meta-resolve-npm-4.1.0-6e93749986-10c0.zip/node_modules/import-meta-resolve/index.js:32:12)
  16   │     at .yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/core/resolve-config.mjs:341:34
  17   │     at Array.map (<anonymous>)
  18   │     at resolveWxtUserModules (.yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/core/resolve
       │ -config.mjs:340:13)
  19   │     at resolveConfig (.yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/core/resolve-config.
       │ mjs:101:29)
  20   │     at async registerWxt (.yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/core/wxt.mjs:11:
       │ 18)
  21   │     at async prepare (.yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/core/prepare.mjs:5:3
       │ )
  22   │     at async .yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/cli/commands.mjs:76:5
  23   │     at async CAC.<anonymous> (.yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/cli/cli-util
       │ s.mjs:17:22)
  24   │     at async .yarn/__virtual__/wxt-virtual-e096b6e3a3/3/.yarn/berry/cache/wxt-npm-0.19.29-e2824c0084-10c0.zip/node_modules/wxt/dist/cli/index.mjs:11:1
Reproduction

This bug occurs on a fresh initialization with zero code changes.

yarn install
➤ YN0000: · Yarn 4.7.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ wxt-react-starter@workspace:. must be built because it never has been before or the last one failed
➤ YN0009: │ wxt-react-starter@workspace:. couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/3l/b3zbvc0j7jlcf_jfpbl_9_540000gn/T/xfs-33d8daf7/build.log)
➤ YN0000: └ Completed in 0s 759ms
➤ YN0000: · Failed with errors in 0s 921ms
Steps to reproduce
  • npx wxt@latest init
  • Select react
  • select yarn

The CD into the new directory

  • yarn install
  • See error
System Info
## Environment

  System:
    OS: macOS 15.3.2
    CPU: (10) arm64 Apple M4
    Memory: 785.31 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.10.0 - /opt/homebrew/bin/node
    Yarn: 4.7.0 - /opt/homebrew/bin/yarn
    npm: 10.9.2 - /opt/homebrew/bin/npm
    pnpm: 10.6.5 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 134.0.6998.118
    Edge: 134.0.3124.83
    Safari: 18.3.1
  npmPackages:
    wxt: ^0.19.29 => 0.19.29
Used Package Manager

npm

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

Reproduce the issue with npx wxt@latest init, selecting React and Yarn, then run yarn install in the generated directory. Start from the postinstall error showing that @wxt-dev/module-react cannot be found and compare the generated initialization with an npm-based setup. Done means a fresh Yarn initialization installs successfully without the missing-package error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.