Skip to content
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

Slightly better null checking (iOS safari issue) #453

Merged
merged 1 commit into from
Jan 10, 2019

Conversation

ajorkowski
Copy link
Contributor

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, only this.$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)

         
this.execHandler = function (name, args) {
  var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  return [(0, _utils.$try)(_this.$handlers[name] && _this.$handlers[name].apply(_this, [_this]), _this.handlers && _this.handlers.apply(_this, [_this])[name].apply(_this, [_this]), fallback, _this.noop).apply(_this, [].concat(_toConsumableArray(args))), _this.execHook(name)]; <---- here
};

 

at event line 271, column 0 (webpack:///../client_modules/node_modules/@material-ui/core/InputBase/InputBase.js:271)

  if (_this.props.onBlur) {
    _this.props.onBlur(event);  <---- here
  }
  var muiFormControl = _this.context.muiFormControl;

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)

@codecov-io
Copy link

Codecov Report

Merging #453 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #453   +/-   ##
=======================================
  Coverage   96.25%   96.25%           
=======================================
  Files         116      116           
  Lines        2245     2245           
=======================================
  Hits         2161     2161           
  Misses         84       84
Impacted Files Coverage Δ
src/Base.js 48% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9021e46...e45c19d. Read the comment docs.

@foxhound87
Copy link
Owner

Please can you create/replicate this issue on a codesandbox so I can also test it?

Thanks you

@foxhound87
Copy link
Owner

I don’t know how to replicate the issue, anyway I’ll merge it if it’s working better for you.

@foxhound87 foxhound87 merged commit 72e69ed into foxhound87:master Jan 10, 2019
foxhound87 added a commit that referenced this pull request Jan 10, 2019
@foxhound87
Copy link
Owner

🎉 This PR is included in version 1.35.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants