wxt-dev / wxt

⚡ Next-gen Web Extension Framework
https://wxt.dev
MIT License
4.59k stars 192 forks source link

Submit command may not be respecting the HTTP_PROXY setting. #981

Open xxnuo opened 2 months ago

xxnuo commented 2 months ago

Describe the bug

Due to poor network conditions, I need to use a proxy to access Google. However, during the refresh token process, I noticed that WXT does not adhere to the system's proxy-related settings including HTTP HTTPS ALL_PROXY. Therefore, I am unable to use the submit command properly.

Reproduction

On this opensource project

https://github.com/xxnuo/jizhi-mod/

Steps to reproduce


echo $HTTP_PROXY
http://127.0.0.1:7890

pnpm wxt submit init
ℹ Initialize or update an existing .env.submit file.                                                                           1:39:15 PM

...

✔ Generate new refresh token?
Yes
[1:39:24 PM] https://accounts.google.com/o/oauth2/auth?response_type=code&scope=xxxx

✔ Open the above URL, login, and enter the auth code:
xxx

 ERROR  [POST] "https://accounts.google.com/o/oauth2/token": <no response> fetch failed                                         1:40:04 PM

  at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
  at async $fetch2 (node_modules/.pnpm/ofetch@1.3.4/node_modules/ofetch/dist/shared/ofetch.897a6909.cjs:274:15)
  at async initChrome (node_modules/.pnpm/publish-browser-extension@2.1.3/node_modules/publish-browser-extension/dist/cli.cjs:3614:17)
  at async init (node_modules/.pnpm/publish-browser-extension@2.1.3/node_modules/publish-browser-extension/dist/cli.cjs:3535:26)
  at async CAC.<anonymous> (node_modules/.pnpm/publish-browser-extension@2.1.3/node_modules/publish-browser-extension/dist/cli.cjs:3907:5)

System Info

System:
    OS: macOS 14.5
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12600KF
    Memory: 34.56 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.8.0 - /usr/local/bin/node
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 9.10.0 - ~/Library/pnpm/pnpm
    bun: 1.1.27 - /usr/local/bin/bun
  Browsers:
    Chrome: 128.0.6613.138
    Safari: 17.5
  npmPackages:
    wxt: ^0.19.7 => 0.19.7

Used Package Manager

pnpm

Validations

aklinker1 commented 2 months ago

I know nothing about http proxies, how to set one up, or how to use them :/

If you're willing to contribute, the code is available at: https://github.com/aklinker1/publish-browser-extension

xxnuo commented 2 months ago

Alright, I'll give it a shot😂