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

Bug: "Unspecified error" some of the time in IE11 in iframe #19530

Closed
mparizeau-pdftron opened this issue Aug 4, 2020 · 12 comments
Closed

Bug: "Unspecified error" some of the time in IE11 in iframe #19530

mparizeau-pdftron opened this issue Aug 4, 2020 · 12 comments

Comments

@mparizeau-pdftron
Copy link

React version: 16.12

Steps To Reproduce

  1. Open http://cygnetuat.sterlingdatarooms.com/PDFTronClientTest/ in IE11
  2. Wait for the application to load in the iframe

The current behavior

Sometimes an "Unspecified error" will appear in the console and the viewer in the iframe won't load

image

Unfortunately it is not 100% reproducible. Sometimes the error won't occur. I'm also having trouble creating a minimal sample to reproduce this.

The expected behavior

There is no error.

Investigation

The relevant line in the callstack where the error is occurring is here

node.ownerDocument.activeElement !== node

I suspect it might be the same issue discussed here Availity/react-block-ui#18

This was a real pain to track down, but apparently IE 11 will just throw Unspecified error. when accessing document.activeElement from an <iframe>, sometimes.

The solution they used to fix the error was to use this function instead of accessing document.activeElement directly https://gist.github.com/Alex1990/046a6553dc83e22dd6f4

Ideally this function could be used inside React as well. I am also happy to use a workaround if there is one.

@mparizeau-pdftron mparizeau-pdftron added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Aug 4, 2020
@bvaughn bvaughn added Component: DOM good first issue Type: Bug and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Aug 5, 2020
@dhavalsingh
Copy link

is anyone working on this? or can i give it a shot?

@pfongkye
Copy link
Contributor

@dhavalsingh are you working on this issue?

@hemakshis
Copy link
Contributor

Hi, is this issue available? If yes, I wanna take it up as my first issue to the React project. Thanks!

@pfongkye
Copy link
Contributor

Hi @hemakshis, I was waiting for @dhavalsingh to reply. I think you can go for it. I can help if needed.

@eps1lon
Copy link
Collaborator

eps1lon commented Aug 18, 2020

@hemakshis All yours. If you get stuck at any point in time feel free to share your progress.

@hemakshis
Copy link
Contributor

Thanks a lot @pfongkye and @eps1lon. Will definitely reach out if I face any issues.

@hemakshis
Copy link
Contributor

Hi, I am unable to reproduce this error, can someone help me with it? And how can I contact you - Discord, IRC, or some other means?
Thanks.

@eps1lon
Copy link
Collaborator

eps1lon commented Aug 19, 2020

Hi, I am unable to reproduce this error, can someone help me with it?

Looking at the initial issue description this might be tough to accomplish:

Unfortunately it is not 100% reproducible. Sometimes the error won't occur. I'm also having trouble creating a minimal sample to reproduce this.

I guess @bvaughn envisioned that this could just be solved by replacing the current read with https://gist.github.com/Alex1990/046a6553dc83e22dd6f4.

But reproducing a IE11-iframe bug that only "sometimes" occurs seems like a pretty hard task to me.

@hemakshis
Copy link
Contributor

hemakshis commented Aug 20, 2020

Hi,
Thanks for your inputs. I was going through the code and found that there is already a very similar implementation done in this file:

getActiveElement.js

export default function getActiveElement(doc: ?Document): ?Element {
doc = doc || (typeof document !== 'undefined' ? document : undefined);
if (typeof doc === 'undefined') {
return null;
}
try {
return doc.activeElement || doc.body;
} catch (e) {
return doc.body;
}
}

This function is being called in a few places but not where the reporter has mentioned the change needs to be done. I think we can reuse this function in mentioned line of description. Please let me know if this sounds correct or not.

@hemakshis
Copy link
Contributor

Hi,
Created #19664
Request you to please review it.
Thanks

@hemakshis
Copy link
Contributor

Hi @pfongkye, @eps1lon, I want to continue contributing so do you think I can take up some other issue, if yes, please let me know? Maybe not as trivial as this one.

@eps1lon
Copy link
Collaborator

eps1lon commented Aug 21, 2020

Closed in #19664

Hi @pfongkye, @eps1lon, I want to continue contributing so do you think I can take up some other issue, if yes, please let me know? Maybe not as trivial as this one.

You can look through the issues marked as "bug" and see if something catches your eye. The conversations might have some hints how a fix might look or whether this this isn't worth fixing because an upcoming refactor might fix it incidentally.

Also triaging issues or simply checking if they're still valid or need an updated reproduction is a form of contributing as well.

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

No branches or pull requests

6 participants