question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'length' of null

See original GitHub issue

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));
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sokracommented, May 24, 2016

Have you tried

System.import(`...`).then(module => cb(null, module.default))
0reactions
sebastienbarrecommented, May 30, 2016

@valerybugakov correct, with a variable. Like this:

        System.import('girder/models/' + modelName).then(function (Model) {
            var parent = new Model.default();
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] TypeError: Cannot read property 'length' of null
This error indicates that the code is trying to compute the length property on a null variable. A null variable holds no or...
Read more >
Cannot read property 'length' of null (javascript) - Stack Overflow
From the code that you have provided, not knowing the language that you are programming in. The variable capital is null. When you...
Read more >
Cannot Read Property Length of Undefined in JavaScript
The JavaScript TypeError: Cannot read property 'length' of undefined occurs when the length property is read on an undefined variable.
Read more >
Uncaught TypeError: Cannot read property 'length' of null error
Hello, I am getting the error “Uncaught TypeError: Cannot read property 'length' of null” in the console and cannot figure out why this...
Read more >
TypeError : Cannot read property "length" from null
The cause of this issue is due to Payload size which is more than 5mb in the rest call. ... "Plain text processor,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found