TypeErrorCannot read properties of undefined (reading ‘hasOwnProperty’)
-
TypeErrorCannot read properties of undefined (reading ‘hasOwnProperty’)
Level: Error
Unhandled
|
New
|
h(widgetapp/2025-01-21-14-07-56/widget_app_base_1737468476256)
Most RelevantFull Stack TraceNewestTypeErrorCannot read properties of undefined (reading ‘hasOwnProperty’)mechanisminstrumenthandledfalsefunctionsetInterval/widgetapp/2025-01-21-14-07-56/widget_app_base_1737468476256.js
inh
at line3:23900
Unminify CodeIn App/widgetapp/2025-01-21-14-07-56/widget_app_base_1737468476256.js
inc
at line3:20994
Unminify CodeIn App/widgetapp/2025-01-21-14-07-56/widget_app_base_1737468476256.js
at line3:22752
Unminify CodeIn App
Chatgpt:
This particular error indicates that somewhere in the UserWay widget script (the
widget_app_base_*.js
file), the code is calling.hasOwnProperty()
on something that turns out to beundefined
. In other words, a script variable or object (commonlyyt.services
in UserWay’s code) isn’t defined when the code expects it to be.Below are common reasons and troubleshooting steps you can take to solve (or at least narrow down) the cause: Why This Error Happens
- Failed to load or fetch configuration (“tunings”)
From the logs, the script tries to fetchhttps://api.userway.org/api/v1/tunings/...
and encounters aTypeError: Failed to fetch
. If the widget depends on that response to properly create theyt.services
object, then failing to fetch the tunings can lead to a situation whereyt.services
isundefined
. Any subsequent code callingyt.services.hasOwnProperty(...)
would then fail with the exact error you’re seeing:
Cannot read properties of undefined (reading 'hasOwnProperty')
- Blocked or misconfigured script
A firewall or a browser extension could be blocking the script fromapi.userway.org
, or there may be network or DNS issues preventing that script from loading. If the script never initializes, the code that referencesyt
oryt.services
will be missing the objects it expects. - Version or embedding issues
If the UserWay widget script is out of date or has been embedded incorrectly (e.g., partial embed code, a stale snippet, or placed in the wrong spot in the HTML), there can be race conditions where the code tries to run before theyt
object is fully available. - Conflict with other scripts
Occasionally, third-party scripts (e.g., caching or bundling plugins, or other accessibility or analytics scripts) can interfere with the loading order, override global variables, or block requests, causing the UserWay code to break unexpectedly.
How to Fix or Work Around It
- Verify the UserWay widget is correctly configured
- Double-check the embed code in your site header or the plugin settings if you installed UserWay via a WordPress plugin.
- Make sure the domain or license key you’re using is valid for
api.userway.org
.
- Check for fetch/cors/firewall issues
- In the DevTools Network tab (or in your hosting logs), ensure the request to
https://api.userway.org/api/v1/tunings/...
is not being blocked. - If you see an error (403, 404, CORS, or timeouts), you’ll need to address that at the server or plugin level.
- Temporarily disable any security/caching plugin (Cloudflare, WordFence, etc.) to see if they’re blocking or altering the request.
- Update or reinstall the UserWay plugin
- If you’re using WordPress, try updating the plugin to its latest version.
- If you’re loading the script manually, get the freshest embed code from UserWay’s portal.
- Check for script conflicts
- If you have multiple accessibility widgets installed, or if there are custom scripts manipulating the same global objects, try temporarily disabling them to see if the error goes away.
- Sometimes minification or bundling tools can cause these conflicts.
- Contact UserWay support if needed
- Since the failing URL is on
api.userway.org
, sometimes the issue can be on their side or relate to your account settings. - Provide them the error logs: specifically the fetch error and the
Cannot read properties of undefined (reading 'hasOwnProperty')
stack trace.
- As a last resort, remove or disable the widget
- If you cannot resolve the error and it is causing site breakage, you may remove or deactivate the script from your site until a fix or updated script is available.
Summary
The short version is that the UserWay script expects certain data (the
"tunings"
, oryt.services
object) to be present. Because that data is never successfully retrieved, the script tries to call.hasOwnProperty()
onundefined
. Fixing the root cause—usually a failed fetch toapi.userway.org
—should make the error disappear.- Make sure the script is up to date and embedded correctly.
- Confirm nothing on your site (plugins, firewall, etc.) is blocking or modifying requests to
api.userway.org
. - If errors persist, consult UserWay support with these log details.
- You must be logged in to reply to this topic.