Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Webpack stats object failing type validation (Cannot load module/asset sizes.) #110

Closed
westbrook-asapp opened this issue Mar 24, 2019 · 5 comments · Fixed by #111
Closed

Comments

@westbrook-asapp
Copy link

westbrook-asapp commented Mar 24, 2019

I'm making the jump from v0.4.0 to ^3.0.0 and when I run my application I get the following display where the application is built, but the module/asset sizes (and problems when available) are blocked from display due to errors. I checked into some similar issues (e.g. #182) in other posts, but most of them discuss development in dependencies like inspectpack, etc. that have since completed, so I'm at a loss.

While webpack is kind of new to me, I'm pretty comfortable saying that the below config is a bit expansive so please let me know what additional or focused information I could supply to help track this issue down. Thanks!

====================================================================

If the issue is visual, please provide screenshots here

image

====================================================================

Steps to reproduce the problem

====================================================================

Please provide a gist of relevant files

Entry script:

ENABLE_SOURCE_MAPS=true NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.local-dev.js --host 0.0.0.0 --no-inline

webpack.config.js

REDACTING PER MANAGEMENT :/ Let me know if there is less complete information I can share in support of finding a solution here!

====================================================================

More Details
  • What operating system are you on? Mac OS
  • What terminal application are you using? Terminal
  • What version of webpack-dashboard are you using? @^3.0.0
  • What is the output of running echo $TERM? xterm-256color
@ryan-roemer
Copy link
Member

Is there any chance that you could create a minimal reproduction for this error in a public repository with install + running instructions?

Alternatively, if a private project, you could create a full stats object with something like:

const { StatsWriterPlugin } = require("webpack-stats-plugin");

module.exports = {
  // ...
  plugins: [
    new StatsWriterPlugin({
      fields: ["assets", "modules"]
    })
  ]
};

in your webpack config, and go through and manually replace all of the "source": field values containing actual source with say: console.log('REMOVED'); or something... That would similarly give us enough to debug further.

Offhand, it looks like the webpack stats object violates inspectpack's type shape, and I'm really curious as to what the stats object looks like / what's going on.

Thanks!!!

@westbrook-asapp
Copy link
Author

I'm going to do what I can. It's a pretty large, private project and my webpack-foo is lacking, but I love creating problems that get people curious and want to help find a solution!

I will say as I address from a couple of different sides, this seems to stem from something the fork-ts-checker-webpack-plugin is doing to the code. Possibly the asyncrony of it all, but that could also be a red herring. Will report back.

@westbrook-asapp
Copy link
Author

OK, I think this is what you're looking for 🤞 https://gist.github.com/westbrook-asapp/a39ea69aece0413e99ea57c6a5783c1f Let me know how else I can support tracking down a resolution to this!

@ryan-roemer
Copy link
Member

Thanks @westbrook-asapp ! Given the size of that beast, I appreciate the effort it must have taken to get that in workable shape to post here.

I am able to suck that into inspectpack straight up and will hopefully be able to figure out what's going on. I'm not sure of exact timeline, but hopefully by end of this week...

@ryan-roemer ryan-roemer transferred this issue from FormidableLabs/webpack-dashboard Mar 26, 2019
@ryan-roemer ryan-roemer changed the title Cannot load module/asset sizes. BUG: Webpack stats object failing type validation (Cannot load module/asset sizes.) Mar 26, 2019
@ryan-roemer
Copy link
Member

ryan-roemer commented Mar 27, 2019

First issue: Expecting string at modules.4.0.chunks.0.0 but instead got: null.

    {
      "id": 4,
      "identifier": "/PATH/TO/node_modules/prop-types/index.js",
      "name": "./node_modules/prop-types/index.js",
      "index": 478,
      "index2": 475,
      "size": 1078,
      "cacheable": true,
      "built": true,
      "optional": false,
      "prefetched": false,
      "chunks": [
        null,
        null,
        null,
        null,
        2,
        4,
        7,
        8,
        9
      ],
      // ... snipped ...
    },

ryan-roemer added a commit that referenced this issue Mar 27, 2019
- Expand type to allow `null` and handle in code. Fixes #110 
- Add regression tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants