Skip to content

packaging with yarn fails behind http proxy #3784

@r10r

Description

@r10r

Hi there,

I run into the following error when trying to package / build xterm.js with yarn
behind a http proxy.

The script addons/xterm-addon-ligatures/bin/download-fonts.js fails to download the fonts.
This seems to be an axios related issue. Related to axios/axios#3903 ?

The related error on the console is:

devcontainer:~/xterm.js# yarn                                                                                                                                                                          
yarn install v1.22.17                                                                                                                                                                                  
warning ../package.json: No license field                                                                                                                                                              
[1/4] Resolving packages...                                                                                                                                                                            
[2/4] Fetching packages...                                                                                                                                                                             
[3/4] Linking dependencies...                                                                                                                                                                          
[4/4] Building fresh packages...                                                                                                                                                                       
warning Your current version of Yarn is out of date. The latest version is "1.22.18", while you're on "1.22.17".                                                                                       
info To upgrade, run the following command:                                                                                                                                                            
$ apk update && apk add -u yarn                                                                                                                                                                        
$ npm run setup                                                                                                                                                                                        
                                                                                                                                                                                                       
> [email protected] presetup                                                                                                                                                                                
> node ./bin/install-addons.js                                                                                                                                                                         
                                                                                                                                                                                                       
pulling addon dependencies...                                                                                                                                                                          
Skipped out                                                                                                                                                                                            
Skipped xterm-addon-attach                                                                                                                                                                             
Skipped xterm-addon-fit                                                                                                                                                                                
Preparing xterm-addon-ligatures                                                                                                                                                                        
warning ../../../package.json: No license field                                                                                                                                                        
Error: Request failed with status code 502                                                                                                                                                             
    at createError (/root/xterm.js/addons/xterm-addon-ligatures/node_modules/axios/lib/core/createError.js:16:15)                                                                                      
    at settle (/root/xterm.js/addons/xterm-addon-ligatures/node_modules/axios/lib/core/settle.js:17:12)                                                                                                
    at IncomingMessage.handleStreamEnd (/root/xterm.js/addons/xterm-addon-ligatures/node_modules/axios/lib/adapters/http.js:269:11)                                                                    
    at IncomingMessage.emit (node:events:538:35)                                                                                                                                                       
    at endReadableNT (node:internal/streams/readable:1345:12)                                                                                                                                          
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {                                                                                                                           
  config: {                                                                                                                                                                                            
    url: 'https://github.com/tonsky/FiraCode/raw/d42e7276fa925e5f82748f3ec9ea429736611b48/distr/otf/FiraCode-Regular.otf',                                                                             
    method: 'get',                                                                                                                                                                                     
    headers: {                                                                                                                                                                                         
      Accept: 'application/json, text/plain, */*',                                                                                                                                                     
      'User-Agent': 'axios/0.21.2',                                                                                                                                                                    
      host: 'github.com'                                                                                                                                                                               
    },                   

Workaround

I ended up downloading the fonts manually using

wget https://github.com/tonsky/FiraCode/raw/d42e7276fa925e5f82748f3ec9ea429736611b48/distr/otf/FiraCode-Regular.otf
mv FiraCode-Regular.otf addons/xterm-addon-ligatures/fonts/firaCode.otf
wget https://github.com/be5invis/Iosevka/releases/download/v1.14.3/01-iosevka-1.14.3.zip
unzip 01-iosevka-1.14.3.zip
mv ttf/iosevka-regular.ttf  addons/xterm-addon-ligatures/fonts

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions