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

Failed to construct 'URL': Invalid URL #343

Closed
Alex0007 opened this issue Dec 3, 2023 · 2 comments
Closed

Failed to construct 'URL': Invalid URL #343

Alex0007 opened this issue Dec 3, 2023 · 2 comments
Labels
bug Something isn't working in progress

Comments

@Alex0007
Copy link

Alex0007 commented Dec 3, 2023

Phanpy dev

UI is empty and this error pops in to the console. Tried to relogin – did not helped.

I think it's related to some specific post in my feed, so it will be hard to reproduce. But it's still worth to catch errors in isMastodonLinkMaybe -> new URL(), i think

TypeError: Failed to construct 'URL': Invalid URL
    at ma (isMastodonLinkMaybe.jsx:2:30)
    at status.jsx:1385:49
@Alex0007
Copy link
Author

Alex0007 commented Dec 3, 2023

It struggles with this URL:

https://doi.oWIO.1177/1071181322661490

That is coming from here

  // Unfurl Mastodon links
  Array.from(
    dom.querySelectorAll(
      'a[href]:not(.u-url):not(.mention):not(.hashtag)',
    ),
  )

Originally this link can be found here: https://wolfdo.gg/notes/9msmwwyrtamr5f8s

(it exists in HTML but not visible anywhere in contents).

So error can be triggered by opening this status: https://dev.phanpy.social/#/mastodon.social/s/111514943336822169

@cheeaun cheeaun added bug Something isn't working in progress labels Dec 3, 2023
@Alex0007
Copy link
Author

Alex0007 commented Dec 3, 2023

Thank you for fix!

@Alex0007 Alex0007 closed this as completed Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress
Projects
None yet
Development

No branches or pull requests

2 participants