lodash / babel-plugin-lodash

Modular Lodash builds without the hassle.
Other
1.96k stars 92 forks source link

Marks 'babel-helper-module-imports' as a non-dev dependency #200

Closed medanat closed 6 years ago

medanat commented 6 years ago

Fixes #199

jsf-clabot commented 6 years ago

CLA assistant check
All committers have signed the CLA.

andreyvital commented 6 years ago

I think you'll also need lodash-compat. Just ran into the same issue here :(

medanat commented 6 years ago

@CentaurWarchief You're right, it's the next issue down the line. I've updated the PR to include lodash-compat.

antixrist commented 6 years ago

@medanat for me without lodash-es in dependencies the same error occur

jdalton commented 6 years ago

Patched https://github.com/lodash/babel-plugin-lodash/commit/04e2fda207816ebd29615559a7a639e34274010f.

antixrist commented 6 years ago

@jdalton without lodash-es and lodash-compat in dependencies I still have following errors: Module build failed: Error: Cannot find module 'lodash-es' Module build failed: Error: Cannot find module 'lodash-compat'

jdalton commented 6 years ago

@antixrist Could you please show me where in the production source those packages are referenced. The Babel 7 compat PR only added 2 deps (babel-helper-module-imports and babel-types)

medanat commented 6 years ago

@jdalton From my understanding, I believe the ModuleCache.resolve method in https://github.com/lodash/babel-plugin-lodash/blob/master/src/ModuleCache.js#L41 tries to require/import them given those packages are listed as the default in https://github.com/lodash/babel-plugin-lodash/blob/master/src/config.js#L7

antixrist commented 6 years ago

@jdalton Those errors thrown from node's module: https://github.com/nodejs/node/blob/82790d84f2049cdd5e9aac4818a096834bed0118/lib/module.js#L540-L545 because you try to resolve all defaultsIds. But lodash-es and lodash-compat not installed because they not included in 'dependencies'

jdalton commented 6 years ago

Hmm, that's not how that should work. 🤔

antixrist commented 6 years ago

@jdalton error's stacktrace has shown that it works completely so as I described