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

Crashes webpack when used in conjunction with pnpIgnorePatterns #29

Open
andreialecu opened this issue Nov 9, 2020 · 0 comments · May be fixed by #30
Open

Crashes webpack when used in conjunction with pnpIgnorePatterns #29

andreialecu opened this issue Nov 9, 2020 · 0 comments · May be fixed by #30

Comments

@andreialecu
Copy link
Contributor

Repro at: https://github.com/andreialecu/repro-yarn-nm-pnp

nm-packages is under pnpIgnorePatterns. Trying to run yarn start:nm fails with:

[error] Error: the specified module doesn't seem to be part of the dependency tree
    at getModuleLocator (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/pnp-webpack-plugin/index.js:21:11)
    at Object.module.exports.moduleLoader (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/pnp-webpack-plugin/index.js:140:23)
    at Object.getCommonConfig (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js:390:40)
    at webpackPartialGenerator (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/@angular-devkit/build-angular/src/browser/index.js:59:27)
    at generateWebpackConfig (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:63:22)
    at async generateBrowserWebpackConfigFromContext (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:154:20)
    at async Object.generateI18nBrowserWebpackConfigFromContext (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/@angular-devkit/build-angular/src/utils/webpack-browser-config.js:95:20)
    at async setup (/home/aandrei/projects/repros/yarn-nm-pnp/nm-packages/angular/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:78:47)

if (!moduleLocation)
throw new Error(`The specified module doesn't seem to exist on the filesystem`);
will be null if the path is under a pnpIgnorePattern path as per yarnpkg/berry#2055

I guess instead of a hard crash there should be a fallback to plain webpack resolution.

@andreialecu andreialecu linked a pull request Nov 9, 2020 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant