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

Uncaught TypeError: Cannot read properties of undefined (reading 'shift') #795

Closed
3 of 5 tasks
sionirvine opened this issue Nov 24, 2021 · 0 comments
Closed
3 of 5 tasks
Labels
bug Bug in code confirmed and identified.

Comments

@sionirvine
Copy link

Before you open an issue:

Affected Version(s): 1.7.3

PHP Version: 7.4.3 FPM

Webserver: Nginx

Browser: Microsoft Edge Version 96.0.1054.29

Installation Type

  • Wordpress x.y.z
  • Mediawiki x.y.z
  • Standalone

Description
using the javascript tracker, it works fine, but my browser logged an error on the console:

Uncaught TypeError: Cannot read properties of undefined (reading 'shift')
at OWA.commandQueue.process (owa.tracker-combined-min.js:formatted:1468)
at owa.tracker-combined-min.js:formatted:2955
at owa.tracker-combined-min.js:formatted:2958

How to reproduce
fresh install of Open Web Analytics 1.7.3, use the owa.tracker-combined manually for my page.

<script type="text/javascript" src="https://*****.com/modules/base/js/owa.tracker-combined-min.js"></script>

the script loaded just fine.

Possible Solution
upon further inspection, it generates an error from this line (from owa.tracker-combined):

this.push(this.asyncCmds.shift(), callback);

from my knowledge, apparently it generates an error because the variable asyncCmds is an empty array, so it has nothing to shift.
so maybe add an empty array check first? hope it helps.

Additional context
None

@sionirvine sionirvine added the bug Bug in code confirmed and identified. label Nov 24, 2021
@padams padams closed this as completed in 92352b6 Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code confirmed and identified.
Projects
None yet
Development

No branches or pull requests

1 participant