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

Some error types don't show error line in Firefox #73

Open
freaktiful opened this issue May 18, 2020 · 0 comments
Open

Some error types don't show error line in Firefox #73

freaktiful opened this issue May 18, 2020 · 0 comments

Comments

@freaktiful
Copy link

When trying this widget in firefox, an error in particular (ReferenceError) does not show the error line. It does in chrome, though.

firefox error

When inspecting the problem, it seems that in Firefox, the filename returned is not only the page URL, but said URL and more text.

firefox error line

Thus, in preview-frame.bundle.js, when checking:

if (typeof (e.lineno) === 'number' &&
	            (e.filename === '' || e.filename === window.location.href)) {
	            line = e.lineno;
	        }

It never satisfies the condition, and the variable line remains undefined.

I've changed (in my local code) the condition to:

(typeof (e.lineno) === 'number' &&
	            (e.filename === '' || e.filename === window.location.href || e.filename.includes(window.location.href))) 

and it seems to work correctly.

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

No branches or pull requests

1 participant