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

Not working with Webpack Dashboard (Works now) #1043

Closed
deadcoder0904 opened this Issue Feb 13, 2018 · 9 comments

Comments

Projects
None yet
2 participants
@deadcoder0904
Contributor

deadcoder0904 commented Feb 13, 2018

pnpm version: 1.32.0

Expected behavior:

Webpack Dashboard must work

Actual behavior:

Webpack Dashboard does not work

Additional information:

  • node -v prints: v9.5.0
  • Windows, OS X, or Linux?: OS X High Sierra 10.13.3

Things that I tried doing

After running I got error -

Error: Cannot find module 'babel-traverse'

so I created pnpmfile.js with following contents -

"use strict";
module.exports = {
  hooks: {
    readPackage
  }
};

function readPackage(pkg) {
  if (pkg.name === "webpack-dashboard") {
    Object.assign(pkg.dependencies, {
      "babel-traverse": "6"
    });
  }
  return pkg;
}

But it still throws error. Also this time, the dependency babel-traverse exists in the package.json

Also take a look at #1022 if you haven't already as it will reduce huge number of issues & save me & others a ton of disk space 😉 otherwise I have to keep deleting projects after completing 😂

@deadcoder0904

This comment has been minimized.

Contributor

deadcoder0904 commented Feb 13, 2018

For now I am using Jarvis which works perfectly fine with pnpm but its in the browser whereas Webpack Dashboard is in the Command Line.

@zkochan

This comment has been minimized.

Member

zkochan commented Feb 13, 2018

I don't know how to use webpack dashboard. Do you have a repo that will help to reproduce the issue?

@deadcoder0904

This comment has been minimized.

Contributor

deadcoder0904 commented Feb 13, 2018

Yep I'll put it on Github

@deadcoder0904

This comment has been minimized.

Contributor

deadcoder0904 commented Feb 13, 2018

I just made one with the tiniest configuration 👉 https://github.com/deadcoder0904/webpack-pnpm

After installing, just run pnpm start

@zkochan

This comment has been minimized.

Member

zkochan commented Feb 13, 2018

this hook seems to help:

module.exports = {
  hooks: {
    readPackage (pkg) {
      if (pkg.name === 'inspectpack') {
        pkg.dependencies['babel-traverse'] = '^6.26.0'
      }
      return pkg
    }
  }
}
@zkochan

This comment has been minimized.

Member

zkochan commented Feb 13, 2018

inspectpack should add babel-traverse to its package.json because it is used here

https://github.com/FormidableLabs/inspectpack/blob/1fa1c0f7052e28e61d4ac8448234e9d34516124a/lib/actions/parse.js#L6

@deadcoder0904

This comment has been minimized.

Contributor

deadcoder0904 commented Feb 14, 2018

I think I got it now, how to do debug this I'll send a PR.

So you basically traverse all the code or is there a script that finds packages that are not in package.json ?

@deadcoder0904

This comment has been minimized.

Contributor

deadcoder0904 commented Feb 14, 2018

It works now without pnpmfile.js. Zoltan can you answer the above question

@deadcoder0904 deadcoder0904 changed the title from Not working with Webpack Dashboard to Not working with Webpack Dashboard (Works now) Feb 14, 2018

@zkochan

This comment has been minimized.

Member

zkochan commented Feb 14, 2018

So you basically traverse all the code or is there a script that finds packages that are not in package.json ?

there is no such script. I wanted to make one but didn't finish it yet. Here's the code: https://github.com/pnpm/node-modules-check

it is not hard to find these errors when code fails. Basically there was an error message like this:

Error: Cannot find module 'babel-traverse'
  at /node_modules/.registry.npmjs.org/inspectpack/2.2.3/node_modules/inspectpack/lib/actions/parse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment