lodash / babel-plugin-lodash

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

Error with lodash/fp from jest #179

Closed namjul closed 7 years ago

namjul commented 7 years ago

Hi everybody,

today we had an Error ReferenceError: /path/to/file.js: Container is falsy with the following callstack

      at NodePath._replaceWith (node_modules/babel-traverse/lib/path/replacement.js:170:11)
      at NodePath.replaceWith (node_modules/babel-traverse/lib/path/replacement.js:160:8)
      at node_modules/babel-plugin-lodash/lib/index.js:144:23
      at arrayEach (node_modules/lodash/_arrayEach.js:15:9)
      at forEach (node_modules/lodash/forEach.js:38:10)
      at node_modules/babel-plugin-lodash/lib/index.js:130:30
      at arrayEach (node_modules/lodash/_arrayEach.js:15:9)
      at forEach (node_modules/lodash/forEach.js:38:10)
      at node_modules/babel-plugin-lodash/lib/index.js:115:28
      at arrayEach (node_modules/lodash/_arrayEach.js:15:9)

The location of the last call would be https://github.com/babel/babel/blob/6.x/packages/babel-traverse/src/path/replacement.js#L168

This happens after starting jest tests. Jest uses the .babelrc https://facebook.github.io/jest/docs/getting-started.html#using-babel

I could further break it down to the usages of property and flatten functions imported from lodash/fp.

I also updated to the latests babel 6 version.

Any ideas what could cause this?

jdalton commented 7 years ago

Hi @namjul, this looks like a jest issue.

namjul commented 7 years ago

thx for hint.