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

build --analyze doesn't work with pnpm #360

Closed
aklinker1 opened this issue Jan 19, 2024 · 1 comment · Fixed by #363
Closed

build --analyze doesn't work with pnpm #360

aklinker1 opened this issue Jan 19, 2024 · 1 comment · Fixed by #363
Labels
bug Something isn't working

Comments

@aklinker1
Copy link
Collaborator

aklinker1 commented Jan 19, 2024

Describe the bug

It relies on a CLI tool, which is a subdependency, so it's not in node_modules/.bin and thus not in the path. This would have started happening after #286

To Reproduce

The vanilla template is enought:

pnpx wxt@latest init repro --pm pnpm --template vue
cd repro
pnpm i
pnpm build --analyze

Here's the full output

$ pnpm build --analyze

> [email protected] build /Users/aklinker1/Development/local/wxt-analysis-2
> wxt build "--analyze"


WXT 0.14.4                                                                                                  7:12:59 AM
ℹ Building chrome-mv3 for production with Vite 5.0.11                                                      7:12:59 AM
✔ Built extension in 360 ms                                                                                7:13:00 AM
  ├─ .output/chrome-mv3/manifest.json              336 B
  ├─ .output/chrome-mv3/popup.html                 462 B
  ├─ .output/chrome-mv3/background.js              10.36 kB
  ├─ .output/chrome-mv3/chunks/popup-H2Bt7_1p.js   3.05 kB
  ├─ .output/chrome-mv3/assets/popup-vfBPF4pa.css  1.24 kB
  ├─ .output/chrome-mv3/icon/128.png               3.07 kB
  ├─ .output/chrome-mv3/icon/16.png                559 B
  ├─ .output/chrome-mv3/icon/32.png                916 B
  ├─ .output/chrome-mv3/icon/48.png                1.33 kB
  ├─ .output/chrome-mv3/icon/96.png                2.37 kB
  ├─ .output/chrome-mv3/stats-0.json               5.65 kB
  ├─ .output/chrome-mv3/stats-1.json               4.22 kB
  └─ .output/chrome-mv3/wxt.svg                    1.07 kB
Σ Total size: 34.63 kB
✖ Command failed after 551 ms                                                                              7:13:00 AM

[7:13:00 AM]  ERROR  Command failed with ENOENT: rollup-plugin-visualizer /Users/aklinker1/Development/local/wxt-analysis-2/.output/chrome-mv3/stats-0.json /Users/aklinker1/Development/local/wxt-analysis-2/.output/chrome-mv3/stats-1.json --template treemap
spawn rollup-plugin-visualizer ENOENT

  spawn rollup-plugin-visualizer ENOENT
  at ChildProcess._handle.onexit (node:internal/child_process:283:19)
  at onErrorNT (node:internal/child_process:476:16)
  at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

 ELIFECYCLE  Command failed with exit code 1.

Expected behavior

Build analysis to finish sucessfully.

Screenshots

N/A

Environment

  System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 1.69 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.1 - ~/.asdf/installs/nodejs/18.16.1/bin/node
    Yarn: 1.22.19 - ~/.asdf/installs/nodejs/18.16.1/bin/yarn
    npm: 9.5.1 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 8.9.0 - ~/.asdf/installs/nodejs/18.16.1/bin/pnpm
  Browsers:
    Chrome: 120.0.6099.234
    Safari: 16.5.2
  npmPackages:
    wxt: ^0.14.0 => 0.14.4

Additional context

Follow up to #355

@aklinker1
Copy link
Collaborator Author

For now, I'm just gonna add node_modules/wxt/node_modules/.bin to the path. See btd/rollup-plugin-visualizer#188 for converting this into a regular JS function call (instead of spawning a child process).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant