electron-webpack-dashboard icon indicating copy to clipboard operation
electron-webpack-dashboard copied to clipboard

Modules pane empty

Open alexkrolick opened this issue 6 years ago • 10 comments

Modules pane empty since latest update (0.1.0-beta.4) nomodules

alexkrolick avatar Aug 22 '17 23:08 alexkrolick

no errors? Did you update your webpack-dashboard plugin as well?

kenwheeler avatar Aug 23 '17 12:08 kenwheeler

Just pushed -5 out. Can you try that?

kenwheeler avatar Aug 23 '17 12:08 kenwheeler

Upgraded both to -5, no change. No errors in the build. I'd check the Electron app itself, but cmd-shift-i to open devtools is disabled.

alexkrolick avatar Aug 23 '17 16:08 alexkrolick

if you pull this repo and npm install/npm run dev, you'll get devtools

kenwheeler avatar Aug 23 '17 16:08 kenwheeler

or, do you have a repo I could try it on?

kenwheeler avatar Aug 23 '17 16:08 kenwheeler

image

No public repo, but looks the problem is the moduleSizes computation

alexkrolick avatar Aug 23 '17 16:08 alexkrolick

@alexkrolick So we have added support for Webpack 3 in Webpack Dashboard in the latest master where modules were not showing up. Does that resolve your issue or could we get some more data? Thanks!

carloskelly13 avatar Oct 10 '17 17:10 carloskelly13

Removing from 1.0 milestone until we have a reproduction / otherwise verify issue.

ryan-roemer avatar Oct 13 '17 13:10 ryan-roemer

I'll check again next week; we were using Webpack 3 so that was probably the problem if it wasn't previously supported.

alexkrolick avatar Nov 05 '17 02:11 alexkrolick

Hey all, I was trying to get this to work on OSX and was having what seemed to be this problem.. Digging deeper a react render error was created by app/util/build-hierarchy.js calling push on an undefined children array of the parentTree variable passed into getFile(...) function.

WAS:

const getFile = function (module, fileName, parentTree) {
  const charIndex = fileName.indexOf('/');

  if (charIndex !== -1) {
    let folder = fileName.slice(0, charIndex);
    if (folder === '~') {
      folder = 'node_modules';
    }

    let childFolder = getChild(parentTree.children, folder);
    if (!childFolder) {
      childFolder = {
        name: folder,
        children: [],
      };
      parentTree.children.push(childFolder);
      // NOTE: here is this issue
    }

    getFile(module, fileName.slice(charIndex + 1), childFolder);
  } else {
    module.name = fileName;
    parentTree.children.push(module);
  }
}

CHANGED TO:

const getFile = function (module, fileName, parentTree) {
  const charIndex = fileName.indexOf('/');

  if (charIndex !== -1) {
    let folder = fileName.slice(0, charIndex);
    if (folder === '~') {
      folder = 'node_modules';
    }

    let childFolder = getChild(parentTree.children, folder);
    if (!childFolder) {
      childFolder = {
        name: folder,
        children: [],
      };
      parentTree.children.push(childFolder);
      // NOTE: here is the fix
      return;
    }

    getFile(module, fileName.slice(charIndex + 1), childFolder);
  } else {
    module.name = fileName;
    parentTree.children.push(module);
  }
}

by adding in a hacky return statement I managed to get the modules and assets etc to load into the view.. This means there is an issue with your underlying recursion here. Anywho hope this aids in further discovery.. Im keen to get using this tool so will fork and fix it myself but let me know anyway 💯

Also NOTE: this was found in V1.0.0 after downloading the .dmg from git/releases.. in case there is a version specific issue

nickmanks avatar Apr 27 '18 05:04 nickmanks