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

Not working with Webpack Dashboard (Works now) #1043

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

Not working with Webpack Dashboard (Works now) #1043

deadcoder0904 opened this issue Feb 13, 2018 · 9 comments

Comments

@deadcoder0904
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
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
Copy link
Contributor Author

Yep I'll put it on Github

@deadcoder0904
Copy link
Contributor Author

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

After installing, just run pnpm start

@zkochan
Copy link
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
Copy link
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
Copy link
Contributor Author

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
Copy link
Contributor Author

deadcoder0904 commented Feb 14, 2018

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

@deadcoder0904 deadcoder0904 changed the title Not working with Webpack Dashboard Not working with Webpack Dashboard (Works now) Feb 14, 2018
@zkochan
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants