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.

ReferenceError: calledOnce is not defined

See original GitHub issue

When used with react-hot-loader it throws this error

VM37389:13 Uncaught ReferenceError: calledOnce is not defined
    at ProxyComponent.result [as getDateFilterMinDateRefinement] (eval at __reactstandin__regenerateByEval (VM36190 CourseSearch.js:NaN), <anonymous>:13:5)
    at eval (eval at __reactstandin__regenerateByEval (VM36190 CourseSearch.js:NaN), <anonymous>:45:36)
    at ProxyFacade (react-hot-loader.development.js:647)
    at mountIndeterminateComponent (react-dom.development.js:13380)
    at beginWork (react-dom.development.js:13820)
    at performUnitOfWork (react-dom.development.js:15863)
    at workLoop (react-dom.development.js:15902)
    at HTMLUnknownElement.callCallback (react-dom.development.js:100)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:138)
    at invokeGuardedCallback (react-dom.development.js:187)

getDateFilterMinDateRefinement() is a function that’s wrapped in memoize().

The error happens, for example, when the component containing memoization is removed from code and then hit “Save” so that it hot-reloads.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nihgwucommented, Sep 7, 2018

@alexreardon thanks for the context, it’s really helpful, I can confirm the error is gone after upgrade react-hot-loader to ^4.3.0, but seems the memoized function won’t be reloaded any more, but that’s not the problem of this library (UPDATE: that’s intended https://github.com/gaearon/react-hot-loader/pull/1002)

Thanks for your great library 👍 , I think it’s good to close now, but change the label to question in case the others meet the same problem

1reaction
nihgwucommented, Sep 6, 2018

Right now I have to workaround like this this.method = module.hot ? this.method : memoize(this.method)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test a simple express app: Uncaught ReferenceError: done is ...
I tried to test a simple express app by following this tutorial. After running mocha test.js Error I got is: done is not...
Read more >
Assertions - Sinon.JS
Sinon.JS ships with a set of assertions that mirror most behavior verification methods and properties on spies and stubs. The advantage of using...
Read more >
Errors | Node.js v18 API
C ReferenceError. Extends: errors.Error. Indicates that an attempt is being made to access a variable that is not defined. Such ...
Read more >
ReferenceError - filename is not defined in ES module scope
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
Read more >
Stack trace API - V8 JavaScript engine
ReferenceError : FAIL is not defined at Constraint.execute ... Note that the custom prepareStackTrace function is only called once the stack property of ......
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