• Resolved davidcarrano

    (@davidcarrano)


    Getting the following error.

    owm-weather-ajax.js?ver=6.2.2:84 Uncaught TypeError: Cannot read properties of undefined (reading ‘weather’)
    at Object.error (owm-weather-ajax.js?ver=6.2.2:84:39)
    at c (jquery.min.js?ver=3.6.4:2:28447)
    at Object.fireWith as rejectWith
    at l (jquery.min.js?ver=3.6.4:2:80201)
    at XMLHttpRequest. (jquery.min.js?ver=3.6.4:2:82630)

    Any help with this is greatly appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter davidcarrano

    (@davidcarrano)

    loader keeps spinning while this error is present. Then I click Cloudfront flush all cache and the error goes away and the weather bug displays as expected. Then, when i refresh the page, the spinning loader and error returns.

    I’m seeing 403s returned on POSTs to /wp-admin/admin-ajax.php?lang=en in the Apache logs, so it seems as though the requests are getting past the WAF, CloudFront and the ALB to Apache.

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    Can you share the website where you are using OWM Weather?

    Thread Starter davidcarrano

    (@davidcarrano)

    I cannot share the website address on a public forum.

    Plugin Author Uwe Jacobs

    (@uwejacobs)

    The OWM Weather shortcode initially places an HTML stub with a spinner on your website. Here’s a brief rundown of its operation:

    1. The HTML stub triggers an Ajax call through owm-weather-ajax.js.
    2. This Ajax call communicates with wp-admin/admin-ajax.php.
    3. The server-side script then fetches the weather data from OpenWeather.
    4. Once retrieved, it formats this weather data.
    5. The formatted data is sent back to owm-weather-ajax.js.
    6. Finally, the spinner on the website is replaced with the formatted weather information.

    From the error details you’ve provided, there seem to be two primary suspects:

    1. Caching Problem: Your site or hosting environment might cache the Ajax response, leading to outdated or stale data, causing the JavaScript error.
    2. Security Restrictions: There might be a security rule, either on your website or hosting environment, that’s preventing the Ajax call from completing successfully. The 403 errors you’re observing are typically indicative of permission or access issues.

    To address these:

    1. If you’re using any caching solutions, try excluding the specific Ajax URL from the cache. This ensures that real-time data is always fetched.
    2. Review any security plugins or server-side rules that might block or restrict access to the wp-admin/admin-ajax.php endpoint. You may need to whitelist this URL or adjust security settings.
    Thread Starter davidcarrano

    (@davidcarrano)

    will try that thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘OWM Weather error owm-weather-ajax.js?ver=6.2.2:84 Uncaught TypeError: Cannot re’ is closed to new replies.