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

Yarn PnP support #2256

Closed
1 task done
dutzi opened this issue Sep 19, 2019 · 2 comments
Closed
1 task done

Yarn PnP support #2256

dutzi opened this issue Sep 19, 2019 · 2 comments

Comments

@dutzi
Copy link

dutzi commented Sep 19, 2019

When trying to use Yarn PnP on my project I get the following error when trying to run yarn run dev (webpack-dev-server --host 0.0.0.0 --port 9004 --mode development):

Error: Couldn't find a suitable Node resolution for unqualified path "/Users/eldad/.config/yarn/global/node_modules/lib/Server"

I'm running Yarn v1.17.3 and webpack-dev-server 3.8.1

  • Operating System: OSX 10.14.6 (18G87)

  • Node Version: v10.15.1

  • NPM Version: 6.4.1

  • Yarn Version: 1.17.3

  • webpack Version: 4.40.2

  • webpack-dev-server Version: 3.8.1

  • Browser: Chrome 77

  • This is a modification request

Update

I think this happens when webpack-dev-server is installed globally, when installed locally I get the following error:

Error: Package "webpack-dev-server@pnp:3a98cc36950646e4b83e17ac76dfd8c7ae624d5c" (via "/Users/eldad/work/conversation/.pnp/externals/pnp-3a98cc36950646e4b83e17ac76dfd8c7ae624d5c/node_modules/webpack-dev-server/bin/webpack-dev-server.js") is trying to require the package "webpack-cli" (via "webpack-cli/bin/config-yargs") without it being listed in its dependencies (webpack, ansi-html, bonjour, chokidar, compression, connect-history-api-fallback, debug, del, express, html-entities, http-proxy-middleware, import-local, internal-ip, ip, is-absolute-url, killable, loglevel, opn, p-retry, portfinder, schema-utils, selfsigned, semver, serve-index, sockjs, sockjs-client, spdy, strip-ansi, supports-color, url, webpack-dev-middleware, webpack-log, ws, yargs, webpack-dev-server)
    at makeError (/Users/eldad/work/conversation/.pnp.js:55:17)
    at Object.resolveToUnqualified (/Users/eldad/work/conversation/.pnp.js:28604:17)
    at Object.resolveRequest (/Users/eldad/work/conversation/.pnp.js:28675:31)
    at Function.Module._resolveFilename (/Users/eldad/work/conversation/.pnp.js:28857:30)
    at Function.Module._load (/Users/eldad/work/conversation/.pnp.js:28773:31)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/eldad/work/conversation/.pnp/externals/pnp-3a98cc36950646e4b83e17ac76dfd8c7ae624d5c/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
@vhiairrassary
Copy link

vhiairrassary commented Sep 20, 2019

webpack-cli is required at https://github.com/webpack/webpack-dev-server/blob/master/bin/webpack-dev-server.js#L65 but it is listed as a devDependencies and not as a dependencies, which is not compatible with Yarn PnP.

I created a simple PR #2257, but I don't know the webpack-dev-server's internals to be sure about the change.

EDIT: it seems there is already some works done: #2191

@dutzi
Copy link
Author

dutzi commented Sep 22, 2019

Ok, I stopped using the webpack-cli from the terminal and tried using it as a node module and it seems to work. Still getting a ton of error regarding @babel/runtime and core-js but whatever.

@dutzi dutzi closed this as completed Sep 22, 2019
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