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

Could not resolve module preprocess-loader #821

Closed
stereokai opened this issue Jun 22, 2017 · 15 comments
Closed

Could not resolve module preprocess-loader #821

stereokai opened this issue Jun 22, 2017 · 15 comments
Assignees

Comments

@stereokai
Copy link

pnpm version: 0.73.2

Expected behavior:

Existing project is able to complete the build (it works when node modules are installed using npm/yarn)

Actual behavior:

Node errors:

  • node -v prints:
ERROR in C:/Users/Tom/.pnpm-store/2/registry.npmjs.org/json3/3.3.2/~/json3/li
b/json3.js
Module not found: Error: Cannot resolve module 'preprocess-loader' in C:\User
s\Tom\.pnpm-store\2\registry.npmjs.org\json3\3.3.2\node_modules\json3\lib
 @ C:/Users/Tom/.pnpm-store/2/registry.npmjs.org/json3/3.3.2/~/json3/lib/json
3.js 1:0-135

ERROR in C:/Users/Tom/.pnpm-store/2/registry.npmjs.org/wtf-8/1.0.0/~/wtf-8/wt
f-8.js
Module not found: Error: Cannot resolve module 'preprocess-loader' in C:\User
s\Tom\.pnpm-store\2\registry.npmjs.org\wtf-8\1.0.0\node_modules\wtf-8
 @ C:/Users/Tom/.pnpm-store/2/registry.npmjs.org/wtf-8/1.0.0/~/wtf-8/wtf-8.js
 1:0-132
  • Windows, OS X, or Linux?:
    Windows
@zkochan
Copy link
Member

zkochan commented Jun 22, 2017

@vjpr is this similar to the one you had?

@vjpr
Copy link
Contributor

vjpr commented Jun 22, 2017

@zkochan Looks similar.

@stereokai Can you post your webpack config?

@vjpr
Copy link
Contributor

vjpr commented Jun 22, 2017

Maybe try to use require.resolve for your loader as mentioned here: https://webpack.js.org/guides/migrating/#loaders-in-configuration-resolve-relative-to-context

@stereokai There is a flag coming to pnpm soon that should fix this. Are you using webpack 1 or 2?

@zkochan That config we discussed would resolve this. @stereokai

@zkochan
Copy link
Member

zkochan commented Jun 22, 2017

ok, if this causes so many issues then I'll make the flag turned off by default. And v1 of pnpm will not symlink leaf dependencies from the global store by default

@stereokai
Copy link
Author

@zkochan But isn't that the whole point of pnpm?

@zkochan
Copy link
Member

zkochan commented Jun 22, 2017

not really, that optimization was introduced only in version 0.70.
The point of pnpm is global store + sane node_modules structure + speed

@vjpr
Copy link
Contributor

vjpr commented Jun 22, 2017

@stereokai pnpm symlinks from node_modules/foo to node_modules/.registry.npmjs.org/foo/x.x.x to give each module a unique ancestry of modules so that transitive deps are perfectly met depending on semver, and then hard links to a central store.

This was just a minor optimisation.

@stereokai
Copy link
Author

@vjpr "unique hierarchy of its transitive deps" sounds like Greek to me :(

@vjpr
Copy link
Contributor

vjpr commented Jun 22, 2017

@stereokai Haha, its really hard to describe in few words. I'll see if I can find the docs explaining it.

@zkochan Do we have some docs on how pnpm works - it seems the docs dir is a bit out of date. The peer deps is nice and detailed but, we need something similar for normal resolution.

@zkochan
Copy link
Member

zkochan commented Jun 22, 2017 via email

@vjpr
Copy link
Contributor

vjpr commented Jun 22, 2017

@stereokai https://www.kochan.io/nodejs/why-should-we-use-pnpm.html

pnpm is usually faster than yarn, and the more deps you have, it becomes much much faster than yarn.

@zkochan zkochan self-assigned this Jun 22, 2017
zkochan added a commit that referenced this issue Jun 22, 2017
BREAKING CHANGE:

independent dependencies are not symlinked from the global store
by default

Close #821
zkochan added a commit that referenced this issue Jun 22, 2017
BREAKING CHANGE:

independent dependencies are not symlinked from the global store
by default

Close #821
@zkochan
Copy link
Member

zkochan commented Jun 23, 2017

not published yet

@zkochan
Copy link
Member

zkochan commented Jun 24, 2017

Published in v0.74.3

@zkochan
Copy link
Member

zkochan commented Jun 27, 2017

@stereokai I also added a documentation page about the node_modules layout that pnpm creates: https://github.com/pnpm/pnpm/blob/master/docs/symlinked-node-modules-structure.md

@stereokai
Copy link
Author

@zkochan That's aweomse of you! Appreciate that.

I'm going now to upgrade to v1 and update here if it solved the issue. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants