Slightly better null checking (iOS safari issue) #453
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems that on iOS Safari I am getting the following error on the line that I have edited in the PR:
Message: undefined is not a function (near '...(0,u.$try)(t.$handlers[e]&&t.$handlers[e].apply(t,[t]),t.handlers&&t.handlers.apply(t,[t])[e].apply(t,[t]),r,t.noop).apply...')
It's hard for me to nail down what the exact cause is, since this is happening on our production environments. The fact that it mentions a functions probably means that the
this.handlers
lookup is probably returning undefined.I took a look through the code, but I couldn't see any usages of the
this.handlers
, onlythis.$handlers
. I'm not really sure what the interaction is down at this level, and how iOS safari comes into play...Here is the longer stack trace that I have. In this example it is on the 'onBlur' event, but I have also seen the issue on 'onFocus' and also on the Form.onSubmit call as well.
Message: undefined is not a function (near '...(0,u.$try)(t.$handlers[e]&&t.$handlers[e].apply(t,[t]),t.handlers&&t.handlers.apply(t,[t])[e].apply(t,[t]),r,t.noop).apply...')
at _this line 72, column 0 (webpack:///../client_modules/node_modules/mobx-react-form/lib/Base.js:72)
at event line 271, column 0 (webpack:///../client_modules/node_modules/@material-ui/core/InputBase/InputBase.js:271)
at d line 16, column 183 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:16)
at f line 16, column 240 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:16)
at Array line 17, column 392 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:17)
at a line 18, column 19 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:18)
at call line 19, column 62 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:19)
at _dispatchInstances line 18, column 289 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:18)
at line 21, column 352 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:21)
at line 86, column 0 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:86)
at W line 216, column 462 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:216)
at nodeName line 39, column 366 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:39)
at call line 87, column 15 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:87)
at context line 217, column 131 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:217)
at ancestors line 86, column 188 (webpack:///../client_modules/node_modules/react-dom/cjs/react-dom.production.min.js:86)
at Tn line , column ([native code]:0)
at dispatchEvent line , column ([native code]:0)
at ? line , column ([native code]:0)