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.

TypeError: Object is not a function

See original GitHub issue

When running example code in my RN app I get:

import memoize from 'proxy-memoize'
const fn = memoize(obj => ({ sum: obj.a + obj.b, diff: obj.a - obj.b }))

=>

image

For some reason that import notation results in .deafult being still present: image

If I do memoize.deafult(...) TS complains, but it works.

Am I importing it wrong? Or could it be something React Native specific? Hermes?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dai-shicommented, Jun 29, 2021
1reaction
dai-shicommented, Jun 29, 2021

Hi folks, A proper fix came to my mind. #25 Please see https://ci.codesandbox.io/status/dai-shi/proxy-memoize/pr/25 and find “Local install instructions”. Let me know if it fixes the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript "Uncaught TypeError: object is not a function ...
Try to have the function body before the function call in your JavaScript file.
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
TypeError: Object(...) is not a function · Issue #14484 - GitHub
What is the current behaviour? I have created react functional component and implement state full logic using useState method but it throws an ......
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >
JavaScript: Uncaught TypeError: n is not a function
This error occurs if you try to execute a function that is not initialized or is not initialized correctly. This means that the...
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