hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.28k stars 288 forks source link

`smui-theme template` command doesn't work with corproate proxy #522

Closed DetachHead closed 1 year ago

DetachHead commented 1 year ago

Describe the bug when attempting to use the smui-theme template command from behind a proxy, node-fetch fails with ETIMEDOUT. i believe this is because node-fetch doesn't support proxies

> npx smui-theme template src/theme
Creating theme files...
Fetching latest theme file from SMUI site...
smui-theme template <location>

Create an SMUI theme template in a given directory

Positionals:
  location  The output directory. If it doesn't exist, it will be created.      
                                                             [string] [required]

Options:
      --version       Show version number                              [boolean]
      --help          Show help                                        [boolean]
  -d, --include-dark  Include a dark theme.            [boolean] [default: true]

FetchError: request to https://raw.githubusercontent.com/hperrin/svelte-material-ui/master/packages/site/src/theme/_smui-theme.scss failed, reason: connect ETIMEDOUT 185.199.109.133:443
    at ClientRequest.<anonymous> (C:\project\node_modules\node-fetch\lib\index.js:1491:11)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:494:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}

To Reproduce Steps to reproduce the behavior:

  1. have a proxy set up and set the HTTP_PROXY and HTTPS_PROXY environment variables
  2. run npx smui-theme template src/theme

Expected behavior no error

Desktop (please complete the following information):