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

Issue with babel & babel-plugin-lodash #393

Closed
julien-f opened this issue Oct 3, 2016 · 5 comments
Closed

Issue with babel & babel-plugin-lodash #393

julien-f opened this issue Oct 3, 2016 · 5 comments

Comments

@julien-f
Copy link

julien-f commented Oct 3, 2016

pnpm version: 0.38.0

Code to reproduce the issue:

https://github.com/julien-f/issue-babel-lodash-pnpm

Expected behavior:

pnpm i should work fine.

Actual behavior:

Packages installation works fine but the build fails:

> @ build issue-babel-lodash-pnpm
> NODE_ENV=production babel --out-dir=dist/ src/

Error: src/index.js: Cannot find module
    at PluginPass.Program (issue-babel-lodash-pnpm/node_modules/babel-plugin-lodash/lib/index.js:97:15)
    at newFn (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:105:12)
    at TraversalContext.visitQueue (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitSingle (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:108:19)
    at TraversalContext.visit (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:192:19)
    at Function.traverse.node (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/index.js:114:17)
    at traverse (issue-babel-lodash-pnpm/node_modules/babel-cli/node_modules/babel-core/node_modules/babel-traverse/lib/index.js:79:12)

Additional information:

  • node -v prints: v6.4.0
  • Windows, OS X, or Linux?: Linux

/cc @jdalton

@jdalton
Copy link

jdalton commented Oct 3, 2016

It looks like you're missing lodash as a dependency.

@julien-f
Copy link
Author

julien-f commented Oct 3, 2016

@jdalton You're right! Shame on me :p

@julien-f julien-f closed this as completed Oct 3, 2016
@julien-f
Copy link
Author

julien-f commented Oct 3, 2016

@jdalton I understand this is a bit weird but shouldn't it work anyway if lodash is not used?

I like to have babel-plugin-lodash set up in all my projects without installing lodash by default.

@jdalton
Copy link

jdalton commented Oct 3, 2016

It won't work without it because it generates resolves paths against the lodash you're using.

@julien-f
Copy link
Author

julien-f commented Oct 3, 2016

Makes sense, too bad for my template module ^^

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