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 Compatibility #5117

Closed
DanielRuf opened this issue Sep 27, 2018 · 9 comments
Closed

Yarn PnP Compatibility #5117

DanielRuf opened this issue Sep 27, 2018 · 9 comments
Milestone

Comments

@DanielRuf
Copy link

DanielRuf commented Sep 27, 2018

Is this a bug report?

Yes

Clone DanielRuf/coding-coach, checkout the feature/yarn-pnp branch and install with Yarn nightly and run yarn start.

Module build failed: Error: Failed to load plugin flowtype: Package "eslint@4.10.0" (via "/Users/druf/Library/Caches/Yarn/v3/npm-eslint-4.10.0-f25d0d7955c81968c2309aa5c9a229e045176bb7/node_modules/eslint/lib/config/plugins.js") is trying to require the package "eslint-plugin-flowtype" (via "eslint-plugin-flowtype") without it being listed in its dependencies (ajv, babel-code-frame, chalk, concat-stream, cross-spawn, debug, doctrine, eslint-scope, espree, esquery, estraverse, esutils, file-entry-cache, functional-red-black-tree, glob, globals, ignore, imurmurhash, inquirer, is-resolvable, js-yaml, json-stable-stringify, levn, lodash, minimatch, mkdirp, natural-compare, optionator, path-is-inside, pluralize, progress, require-uncached, semver, strip-ansi, strip-json-comments, table, text-table, eslint)
Referenced from: 
    at Array.forEach (<anonymous>)
    at Array.reduceRight (<anonymous>)

Did you try recovering your dependencies?

Not needed as this is a clean install.

Which terms did you search for in User Guide?

Environment

The project uses react-scripts@1.1.5.

(paste the output of the command here)

Steps to Reproduce

Clone DanielRuf/coding-coach, checkout the feature/yarn-pnp branch and install with Yarn nightly and run yarn start.

  1. Clone DanielRuf/coding-coach
  2. checkout the feature/yarn-pnp branch
  3. install Yarn nightly
  4. run yarn && yarn start

Expected Behavior

(Write what you thought would happen.)

It should run without any errors.

Actual Behavior

I've got

Module build failed: Error: Failed to load plugin flowtype: Package "eslint@4.10.0" (via "/Users/druf/Library/Caches/Yarn/v3/npm-eslint-4.10.0-f25d0d7955c81968c2309aa5c9a229e045176bb7/node_modules/eslint/lib/config/plugins.js") is trying to require the package "eslint-plugin-flowtype" (via "eslint-plugin-flowtype") without it being listed in its dependencies (ajv, babel-code-frame, chalk, concat-stream, cross-spawn, debug, doctrine, eslint-scope, espree, esquery, estraverse, esutils, file-entry-cache, functional-red-black-tree, glob, globals, ignore, imurmurhash, inquirer, is-resolvable, js-yaml, json-stable-stringify, levn, lodash, minimatch, mkdirp, natural-compare, optionator, path-is-inside, pluralize, progress, require-uncached, semver, strip-ansi, strip-json-comments, table, text-table, eslint)
Referenced from: 
    at Array.forEach (<anonymous>)
    at Array.reduceRight (<anonymous>)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@DanielRuf
Copy link
Author

It's similar with @next:

Error: Package "webpack-dev-middleware@3.4.0" (via "/Users/druf/Library/Caches/Yarn/v3/npm-webpack-dev-middleware-3.4.0-1132fecc9026fd90f0ecedac5cbff75d1fb45890/node_modules/webpack-dev-middleware/lib/fs.js") is trying to require the package "webpack" (via "webpack/lib/node/NodeOutputFileSystem") without it being listed in its dependencies (memory-fs, mime, range-parser, webpack-log, webpack-dev-middleware)
    at makeError (/Users/druf/projects/coding-coach/.pnp.js:47:17)
    at Object.resolveToUnqualified (/Users/druf/projects/coding-coach/.pnp.js:20767:17)
    at Object.resolveRequest (/Users/druf/projects/coding-coach/.pnp.js:20838:31)
    at Function.Module._resolveFilename (/Users/druf/projects/coding-coach/.pnp.js:20990:32)
    at Function.Module._load (/Users/druf/projects/coding-coach/.pnp.js:20936:31)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/druf/Library/Caches/Yarn/v3/npm-webpack-dev-middleware-3.4.0-1132fecc9026fd90f0ecedac5cbff75d1fb45890/node_modules/webpack-dev-middleware/lib/fs.js:7:30)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

@DanielRuf
Copy link
Author

After running yarn add webpack --dev:

Error: Package "react-dev-utils@6.0.0" (via "/Users/druf/Library/Caches/Yarn/v3/npm-react-dev-utils-6.0.0-e254f94a29ba0a63561225bbccbdec5f2ec52ade/node_modules/react-dev-utils/getCSSModuleLocalIdent.js") is trying to require the package "loader-utils" (via "loader-utils") without it being listed in its dependencies (@babel/code-frame, address, browserslist, chalk, cross-spawn, detect-port-alt, escape-string-regexp, filesize, global-modules, gzip-size, inquirer, is-root, opn, pkg-up, react-error-overlay, recursive-readdir, shell-quote, sockjs-client, strip-ansi, text-table, react-dev-utils)
    at makeError (/Users/druf/projects/coding-coach/.pnp.js:47:17)
    at Object.resolveToUnqualified (/Users/druf/projects/coding-coach/.pnp.js:20995:17)
    at Object.resolveRequest (/Users/druf/projects/coding-coach/.pnp.js:21066:31)
    at Function.Module._resolveFilename (/Users/druf/projects/coding-coach/.pnp.js:21218:32)
    at Function.Module._load (/Users/druf/projects/coding-coach/.pnp.js:21164:31)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/druf/Library/Caches/Yarn/v3/npm-react-dev-utils-6.0.0-e254f94a29ba0a63561225bbccbdec5f2ec52ade/node_modules/react-dev-utils/getCSSModuleLocalIdent.js:10:21)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@DanielRuf
Copy link
Author

After adding a browserlist-config to package.json:

Error: Cannot find module 'loader-runner'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/druf/Library/Caches/Yarn/v3/npm-thread-loader-1.2.0-35dedb23cf294afbbce6c45c1339b950ed17e7a4/node_modules/thread-loader/dist/worker.js:11:21)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
internal/modules/cjs/loader.js:583
    throw err;
    ^

@DanielRuf
Copy link
Author

yarn why thread-loader
yarn why v1.12.0-20180926.1157
[1/4] 🤔  Why do we have the module "thread-loader"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "react-scripts#thread-loader@1.2.0"
info Reasons this module exists
   - "react-scripts" depends on it
   - in the nohoist list null
✨  Done in 1.42s.

@gaearon
Copy link
Contributor

gaearon commented Sep 27, 2018

cc @arcanis

@arcanis
Copy link
Contributor

arcanis commented Sep 27, 2018

Hey @DanielRuf! I think this issue is related to eslint/eslint#10125 (and more generally the thread that I started at eslint/eslint#10643 (comment))

cc @not-an-aardvark

@gaearon
Copy link
Contributor

gaearon commented Sep 27, 2018

@arcanis Can I ask you to look into non-ESLint related issues in the meantime? Seems like there are others with thread-loader and something else in this thread. It's related to our 2.x release where we merged a bunch of stuff into master. You can try with #5103.

@gaearon gaearon changed the title issue with Yarn PnP and eslint 4 Yarn PnP Compatibility Sep 27, 2018
@arcanis
Copy link
Contributor

arcanis commented Sep 27, 2018

Looking 👍

@arcanis
Copy link
Contributor

arcanis commented Sep 27, 2018

@Timer Timer added this to the 2.x milestone Sep 27, 2018
@Timer Timer modified the milestones: 2.x, 2.0 Oct 1, 2018
@lock lock bot locked and limited conversation to collaborators Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants