question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest: TypeError: Cannot read property 'fantasy-land/map'

See original GitHub issue

I’m testing a React app with Jest and when some code hits a R.map() function, i get the following error:

TypeError: Cannot read property 'fantasy-land/map' of undefined

      at node_modules/ramda/src/internal/_dispatchable.js:29:23
      at Object.f2 [as map] (node_modules/ramda/src/internal/_curry2.js:25:16)

Looks related to the fantasy-land inclusion. Gotta say i don’t know how this can be fixed.

Ramda 0.24.1 Jest 20.0.4

If i comment the lines using those R.map() functions, error goes away.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

28reactions
CrossEyecommented, Sep 22, 2017

Ramda has long taken a stand against hand-holding, assuming users would pass the correct types to its functions, and not checking this unless necessary. While I think that sentiment is slowly shifting, it’s not at all clear to me that Ramda is ready for that sort of argument validation.

15reactions
buzzdecafecommented, Jun 27, 2017

There’s nowhere near enough context to offer any help here. I suspect that an undefined value is being passed as the second arg to map. But that is just a guess.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'fantasy-land/map' of undefined Dash ...
Short answer. Dash's DataTable needs to be initialized with empty rows to work properly. dt.DataTable(id='my-datatable', rows=[{}]).
Read more >
ramda/ramda
fantasy -land is a spec for FP-friendly types in JS. A fantasy-land compliant functor is ... TypeError: Cannot read property 'fantasy-land/map' of undefined...
Read more >
React - Cannot read property 'map' of undefined - debuggr.io
map and returning a react element for each item. But we wont see anything on the screen, well except the error: TypeError: Cannot...
Read more >
Cannot read property 'fantasy-land/map' of undefined Dash ...
Coding example for the question Cannot read property 'fantasy-land/map' of undefined Dash DataTable Updating table with dropdowns-Reactjs.
Read more >
rambdax/README.md
209, - Rambda's **map**, **filter**, **partition** when they iterate over objects, ... 3965, throw new Error(`Cannot read property 'indexOf' of ${list}`).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found