TypeError: Cannot read property ‘length’ of null

Using webpack 2 beta 6.

Trace:

chunk main [entry]
3-12ccc3f32505ae5e2d7e.js
Cannot read property 'length' of null
TypeError: Cannot read property 'length' of null
    at /Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/ContextModule.js:139:25
    at Array.forEach (native)
    at Module.ContextModule.source (/Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/ContextModule.js:137:6)
    at Template.ModuleTemplate.render (/Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/ModuleTemplate.js:14:28)
    at Template.renderChunkModules (/Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/Template.js:115:31)
    at Template.<anonymous> (/Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/MainTemplate.js:36:22)
    at Template.applyPluginsWaterfall (/Users/mmahalwy/Sites/sparrow/node_modules/tapable/lib/Tapable.js:34:24)
    at Template.MainTemplate.render (/Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/MainTemplate.js:129:20)
    at Compilation.createChunkAssets (/Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/Compilation.js:845:33)
    at Compilation.<anonymous> (/Users/mmahalwy/Sites/sparrow/node_modules/webpack/lib/Compilation.js:556:9)

Relevant code:

const loadContainerAsync = route => (location, cb) => {
  console.log(location, cb);
 //  require.ensure([], (require) => {
 //    cb(null, require('./containers/' + route + '/index.js'));
 // });
 // console.log(location);
 return System.import(`./containers/${route}/index.js`).then(module => cb(null, module)).catch(err => console.log(err));
};

Author: Fantashit

1 thought on “TypeError: Cannot read property ‘length’ of null

Comments are closed.

TypeError: Cannot read property ‘length’ of null

return (buffers.length === 1 ? buffers[0] : Buffer.concat(buffers, nread));
const zlib = require('zlib');

const arr= new Int8Array([0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
console.log(zlib.gunzipSync(arr))
zlib.js:488
  return (buffers.length === 1 ? buffers[0] : Buffer.concat(buffers, nread));
                  ^

TypeError: Cannot read property 'length' of null
    at processChunkSync (zlib.js:488:19)
    at zlibBufferSync (zlib.js:119:12)
    at Object.gunzipSync (zlib.js:646:14)
    at Object.<anonymous> (D:\tests\2017\11\test-zlib.js:7:18)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Function.Module.runMain (module.js:682:10)
  • Version: v9.0.0
  • Platform: Windows 8.1 64-bit

It works fine on 6, 7 and 8 node versions.

Author: Fantashit

1 thought on “TypeError: Cannot read property ‘length’ of null

Comments are closed.