interledger / web-monetization-extension

An open-source browser extension that enables Web Monetization.
Apache License 2.0
46 stars 2 forks source link

[BUG] Unhandled dispatch event type error. #352

Closed marclevin closed 1 week ago

marclevin commented 1 week ago

Steps to reproduce

Context: Bug encountered while running a nextjs react application using typescript in dev mode on Chrome for windows.

Steps:

  1. Enable the web-monetization extension.
  2. Visit any page of the nextjs react app.

Expected result

Typical behaviour expected, with the extension looking for the monetization tag in the HTML.

  1. DOM loads
  2. Extension seeks the monetization tag in the DOM.
  3. Tag is either found or not found.
  4. Normal behaviour should continue.

Actual result

Upon visiting any page, an unhandled runtime exception occurs. var monetizationTag = document.querySelector('link[rel="monetization"]'); monetizationTag.dispatchEvent(new Event('load'));

The issue is being caused by the tag being null, so the dispatch event being called is also null.

Screenshots or videos

Screenshot of the html causing the issue: image

Exact line causing the issue:

image

Additional context

No response

Operating system

Windows

Operating system version

10.0.22631

Browsers

Chrome

Browser version

126.0.6478.61

Extension version

1.0.1

raducristianpopa commented 1 week ago

I am noticing that you are running a really old version of the extension. Can you download the version that is mentioned in alpha 1 release discussion and let us know if you are heving the same issues?

Alpha 1 Release discussion

marclevin commented 1 week ago

The issue was the old extension version I obtained from the releases page. Thanks!