title: Uncaught (in promise) TypeError: Cannot read property 'prototype' of undefined
body: <p>I'm working in a project with electronjs + vue to implement adb operations in desktop application. For the implementation of this i am using the node library adbkit.</p>
  <p>When I tried to load script i get an error during the <strong>require('adbkit')</strong> operation during webpack. The error that i got is the following:</p>
  <p><img src="https://i.stack.imgur.com/0rEWA.png" alt="enter image description here" /></p>
  <p>My configuration for webpack is the following:</p>
  <pre><code>const { defineConfig } = require('@vue/cli-service')
  module.exports = defineConfig({
    transpileDependencies: true,
    
    configureWebpack: {
      resolve: {
        fallback: {
          &quot;crypto&quot;: require.resolve(&quot;crypto-browserify&quot;),
        },
        
      },
      externals:{
        &quot;fs&quot;: require(&quot;fs&quot;),
        &quot;child_process&quot;: require(&quot;child_process&quot;),
  
      }
    },
  })
  </code></pre>
  <p>The script that i am using to get device storage:</p>
  <pre><code>/* eslint-disable */
  export function memory() {
    var Promise = require('bluebird');
    var adb = require('adbkit');
    const client = adb.createClient();
    //var readline = require('readline');
    var capaccity = null;
    var used = null;
    var free = null;
    var stat = null;
  
  
    return new Promise(function (resolve) {
      client.listDevices()
        .then(function (devices) {
          if(devices.length != 0) {
            console.log('Device %s ', devices[0].id)
            var check = false;
            client.shell(devices[0].id, &quot;df -h&quot;, function (err, output) {
              if (err) {
                console.log(err);
              }
              var readStream = output;
              
              var importantdata = [];
              readStream
                .on('data', function (data) {
                  //console.log('Data!', data.toString());  
                  var lines = data.toString().split('n');
                  //if(lines.includes('/dev/fuse')){
                  //    console.log(lines);
                  //}
                  lines.forEach(element =&gt; {
                    if (element.includes('/dev/fuse')) {
                      //console.log(element)
                      var info = element.toString().split(' ');
                      info.forEach(info =&gt; {
                        if (info != '') {
                          importantdata.push(info)
                        }
                      })
  
                    }
                  });
  
                  if (importantdata.length != 0) {
                    capaccity = importantdata[1] + 'B'
                    used = importantdata[2] + 'B'
                    free = importantdata[3] + 'B'
                    stat = '&quot;'+importantdata[4]+'&quot;'
                    check = true
                    //console.log([capaccity, used, free, stat]);
                    resolve([capaccity, used, free, stat])
                  }
                })
                .on('error', function (err) { console.error('Error', err); })
  
  
            })
            if (check == false) {
              client.shell(devices[0].id, &quot;df&quot;, function (err, output, capaccity, used, free, stat, importantdata) {
                if (err) {
                  console.log(err);
                }
                var readStream = output;
                importantdata = [];
                readStream
                  .on('data', function (data) {
                    //console.log('Data!', data.toString());  
                    var lines = data.toString().split('n');
                    lines.forEach(element =&gt; {
                      if (element.includes('/storage/emulated')) {
                        //console.log(element)
                        var info = element.toString().split(' ');
                        info.forEach(info =&gt; {
                          if (info != '') {
                            importantdata.push(info)
  
                          }
                        })
  
                      }
                    });
                    if (importantdata.length != 0) {
                      capaccity = importantdata[1] + 'B'
                      used = importantdata[2] + 'B'
                      free = importantdata[3] + 'B'
                      stat = '&quot;'+((parseFloat(importantdata[2].replace('G', '')) / parseFloat(importantdata[1].replace('G', ''))) * 100.0).toFixed(2) + '%&quot;';
                      //return [capaccity, used, free, percentage]
                      //console.log([capaccity, used, free, stat]);
                      resolve([capaccity, used, free, stat])
                    }
                  })
                  .on('error', function (err) { console.error('Error', err); })
  
  
  
              })
            }
          }
  
  
  
        })
    })
  
  }
  </code></pre>
  <p>And the view when i execute the following script:</p>
  <pre><code>&lt;template &gt;
    &lt;div class=&quot;home&quot;&gt;
      &lt;img src=&quot;../assets/mobile_image.png&quot; class=&quot;imagemobile&quot; /&gt;
      &lt;h1 class=&quot;textheader&quot;&gt;
        &lt;font size=&quot;5&quot; id=&quot;brand&quot;&gt;Teléfono Móvil&lt;/font&gt;
      &lt;/h1&gt;
      &lt;h2 class=&quot;modelo&quot;&gt;
        &lt;font size=&quot;3&quot; id=&quot;model&quot;&gt; Modelo &lt;/font&gt;
      &lt;/h2&gt;
      
      &lt;h3 class=&quot;textcontent&quot;&gt;
        &lt;i&gt; Información sobre el Teléfono &lt;/i&gt;
      &lt;/h3&gt;
  
      &lt;div class=&quot;barcontent&quot;&gt;
        
        &lt;div style=&quot;text-align: left;&quot;&gt;Almacenamiento&lt;/div&gt;
        
        
        &lt;div class=&quot;progress-bar&quot;&gt;
          &lt;div class=&quot;progress-bar-fill-ocuppied&quot;&gt;&lt;/div&gt; &lt;!--- PREGUNTAR SI ASI O ABAJO --&gt;
        &lt;/div&gt;
        
        &lt;div style=&quot;display:inline&quot;&gt;
          
          &lt;p id=&quot;alma-ocupado&quot; class=&quot;info-alma-ocupado&quot;&gt;Ocupados 114GB&lt;/p&gt;
          
          &lt;p id=&quot;alma-disp&quot; class=&quot;info-alma-libre&quot;&gt;Libres 24GB&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class=&quot;totalcapacity&quot;&gt;Almacenamiento total: 128 GB&lt;/div&gt;
        
        
      &lt;/div&gt;
      &lt;img src=&quot;../assets/android.jpg&quot; class=&quot;imageandroid&quot; /&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import {memory} from './prueba'
  
  export default {
    name: &quot;HomeView&quot;,
    mounted(){
      
      const pb1 = new ProgressBar(document.querySelector('.progress-bar'));
      pb1.setValue(&quot;0%&quot;);
      
      memory().then(function (resolve) {
        pb1.setValue(resolve[3])
      })
      
  
      
  
    },
  };
  class ProgressBar{
    constructor(element,initialValue=&quot;0%&quot;){
      this.Ocuppied = element.querySelector('.progress-bar-fill-ocuppied');
      this.setValue(initialValue);
    }
  
    setValue (newValue){
      this.value = newValue;
      this.update();
    }
  
    update(){
      const percentageoccupied = this.value;
  
      this.Ocuppied.style.width = percentageoccupied;
      
    }
  
   
  }
     
  &lt;/script&gt;
  
  &lt;style&gt;
  .info-alma-ocupado{
    text-align: left;
    
    display: inline;
    
    width: 50%;
    padding-left: 0px;
    margin-right: 33%;
  }
  .info-alma-libre{
    display: inline;
    width: 100%;
    height: 50%;
    text-align: right !important;
    align-items: right !important;
    margin-left: 33%;
  }
  .bloque{
    display: inline-block;
    align-content: initial;
  }
  .imagemobile {
    float: left;
    margin-left: 10%;
    margin-top: 5%;
    width: 15%;
    height: auto;
  }
  .imageandroid {
    margin-right: 10%;
    margin-top: 5%;
    float: right;
    width: 20%;
    height: auto;
  }
  .textheader {
    margin: 0;
    position: absolute;
    margin-top: 5%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 90%;
  }
  
  .modelo {
    margin: 0;
    position: absolute;
    margin-top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 90%;
  }
  .textcontent {
    margin: 0;
    position: absolute;
    margin-top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60%;
  }
  
  .almacenamiento {
    text-align: left;
  }
  
  .barcontent {
    margin: 0;
    position: absolute;
    margin-top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 90%;
    border: 20px;
    
    /*border: 10px solid #000; */
  }
  
  
  .progress-bar {
    position: relative;
    float: center;
    width: 600px;
    height: 50px;
    border: 1px solid #000;
    background-color: #0a9905;
  }
  
  .progress-bar-fill-ocuppied {
    float: left;
    height: 100%;
    width: 40%;
    background: #9b0b0b;
    transition: width 0.5s;
    position: absolute;
  }
  
  
  &lt;/style&gt;
  </code></pre>
  <p>The result of the script should be that i got the percentatge of storage and then show it in front</p>