-
-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined is not a function #425
Comments
It might be a problem with another dependency, build setup thing you have,
like a misconfigured polyfill. Im afraid we can't do much without isolated
test case.
Op ma 16 sep. 2019 12:27 schreef jordyvandomselaar <notifications@github.com
…:
I realize this is not enough information at all but I hope you can help me
find the problem if possible.
Our Bugsnag is reporting the following error:
TypeError undefined is not a function
../node_modules/immer/dist/immer.module.js:121 each
../node_modules/immer/dist/immer.module.js:503 Object.<anonymous>
../node_modules/immer/dist/immer.module.js:1113:15 Object.<anonymous>
https://dwf.hockeyweerelt.nl/:1:1651 f
api/comments.js:29:55 Object.push.615
https://dwf.hockeyweerelt.nl/:1:1651 f
https://dwf.hockeyweerelt.nl/static/js/main.7417baf1.chunk.js:1:84 Object.push.279
https://dwf.hockeyweerelt.nl/:1:1651 f
https://dwf.hockeyweerelt.nl/:1:1520 p
https://dwf.hockeyweerelt.nl/:1:1383 Array.e [as push]
From what I can tell the problem comes from the following piece of code:
function each(value, cb) {
if (Array.isArray(value)) {
for (var i = 0; i < value.length; i++) {
cb(i, value[i], value);
}
} else {
ownKeys(value).forEach(function (key) {
return cb(key, value[key], value);
});
}
}
Specifically ownKeys -- This is an assumption but I think ownKeys is
somehow undefined.
The affected browsers are:
1. Edge 16.16299.0
2. Edge 18.17763.0
3. Edge 17.17134.0
4. Chrome 60.0.3112
5. Chrome 61.0.3163
6. Chrome 72.0.3626
7. Chrome 73.0.3683
8. Chrome 74.0.3729
9. Chrome 75.0.3770
10. Chrome 76.0.3809
Reproduction
I honestly don't know, I've tried reproducing it but unfortunately
It works on my machine
I also can't reproduce it on BrowserStack.
Environment
- *Immer version: 1.7.2*
- [x ] Occurs with setUseProxies(true) -- Assuming this is the default
- Occurs with setUseProxies(false) (ES5 only)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#425?email_source=notifications&email_token=AAN4NBGQHO64NFFPVQVRIBTQJ5UTJA5CNFSM4IXA6OVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HLRXA2Q>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN4NBAGLXGH7QLYJOZPDG3QJ5UTJANCNFSM4IXA6OVA>
.
|
Alright, thanks for having a look! I'll close this issue for now and re-open it if at some point I find more useful information. |
Just to add another (rather useless) datapoint, I have been getting this runtime issue as well in Rollbar with Immer 5.0.1. |
Also adding a (semi useless) datapoint in that we are seeing this often, with immer 6.0.1. We also use rollbar, seeing this a few hundred times a day, all on Windows 8/10, recent chrome (79, 80 at this time). Also no luck reproducing in browserstack. Seeing this come up across a few thousand different IPs, so it's not just a few odd users. I traced through our minified code to arrive at the some conclusion at the OP, in that Since I can't reproduce, or provide an isolated case, I know this is not super useful, but figured it was worth adding data points in case someone can build up a better picture. |
I pushed a possible fix as |
@mweststrate thanks for the patch fix. We pushed that out to production last week, and unfortunately, we're seeing the same rate of errors coming in. The only new information I have is that we've recently started seeing some errors from Edge 18 in addition to Chrome, but still all on Windows. |
Also seeing this. Similarly all on Chrome/Windows users. Happens when redux-toolkit > immer calls |
Would be great if people here share what webpack / babel / polyfill setups they are using. I highly suspect that there is a broken polyfill somewhere, that causes one of the built-ins used by |
It would be great if someone could check if Immer 7 somehow magically fixes this :). Not that I did anything deliberately to address is, but some built-ins have been swapped with different functionality, and Immer can now handle polyfilled symbols better. |
Hi @mweststrate I have this issue in react-native with immer v7 and hermes enabled (the issue only happens with hermes enabled). Steps to reproduce:
Immer v6 works with hermes. |
Same here, I'm having the same issue when using v7 with Hermes enabled. Any idea on how to fix it using V7? |
@ahce / @elkinjosetm could you please open a new issue, as this one is closed and about IE and Chrome, not hermes? Comments on closed issues are typically not seen by others. If you could infer from the stack or a debugger break point which function is undefined that'd be great. |
I realize this is not enough information at all but I hope you can help me find the problem if possible.
Our Bugsnag is reporting the following error:
From what I can tell the problem comes from the following piece of code:
Specifically
ownKeys
-- This is an assumption but I thinkownKeys
is somehowundefined
. I came to this assumption because that's what's on line121
.The affected browsers are:
Reproduction
I honestly don't know, I've tried reproducing it but unfortunately
I also can't reproduce it on BrowserStack.
Environment
setUseProxies(true)
-- Assuming this is the defaultsetUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: