caiogondim / fast-memoize.js

:rabbit2: Fastest possible memoization library
https://npm.im/fast-memoize
MIT License
2.58k stars 86 forks source link

cacheDefault is not defined #41

Closed mreishus closed 7 years ago

mreishus commented 7 years ago

Anyone seen this? It happens as soon as I load my app.

Uncaught ReferenceError: cacheDefault is not defined
    at memoize (eval at <anonymous> (vendor.js:2571), <anonymous>:8:7)
    at eval (eval at <anonymous> (commons.js:72), <anonymous>:171:87)
    at Object.<anonymous> (commons.js:72)
    at __webpack_require__ (vendor.js:692)
    at fn (vendor.js:111)
    at eval (eval at <anonymous> (commons.js:84), <anonymous>:8:66)
    at Object.<anonymous> (commons.js:84)
    at __webpack_require__ (vendor.js:692)
    at fn (vendor.js:111)
    at eval (eval at <anonymous> (commons.js:1694), <anonymous>:8:69)

My call to it is pretty simple:

import memoize from 'fast-memoize';
export const haystackMatchesSearchObject = memoize(_haystackMatchesSearchObject);

My webpack config is quite complex though, with hot reloading, I wonder if that's the cause

FlorianWendelborn commented 7 years ago

Does this happen with older versions? There was a refactor some hours ago.

mreishus commented 7 years ago

It still happens for 2.1.1 for me. However, if I take the latest index.js file and include it directly in my project and import from it instead of npm, it works.. I'll do that for now. :)

FlorianWendelborn commented 7 years ago

You can npm install from a repo too.