I am currently running on magento 2.3 site, and finding that the site will sometimes load all of its Javascript components and dependencies properly, but sometimes fails to load.
IF you hard-refresh/clear your browser cache it works and all the errors disappear for that page, but if you browse the site it will throw the errors again after visiting a few pages.
Also page refresh errors are change. Below are few sample errors.
Uncaught TypeError: Cannot read property 'fn' of undefined
at observable_array.js:54
Uncaught TypeError: Cannot set property 'disposableCustomerData' of undefined
at customer-data.js:101
Related
Aim
To create a local copy of a WordPress site using DevKinsta.
Issue
Everything is working currently in the local site copy except for the checkout page. Something can be added to the basket without problems, then the checkout page shows the heading for 'Enter billing details' and nothing else. No payment options or input fields.
When I right click Inspect -> Console in the browser, I get:
GET 500 error for the checkout URL
Uncaught TypeError: Cannot read properties of undefined (reading 'setDefaults')
Uncaught TypeError: Cannot read properties of undefined (reading 'setDefaults')
at HTMLDocument.<anonymous> (ajax.js:2:22)
at i (jquery.js:2:27362)
at Object.fireWith [as resolveWith] (jquery.js:2:28121)
at Function.ready (jquery.js:2:29914)
at HTMLDocument.J (jquery.js:2:30276)
Uncaught TypeError: Cannot read properties of undefined (reading 'addMethod')
Uncaught TypeError: Cannot read properties of undefined (reading 'addMethod')
at HTMLDocument.<anonymous> (custom.js:176:22)
at fire (jquery.js:3187:31)
at Object.fireWith [as resolveWith] (jquery.js:3317:7)
at Function.ready (jquery.js:3536:13)
at HTMLDocument.completed (jquery.js:3552:9)
This WooCommerce docs link suggests themes and plugins can be common causes of JavaScript errors with WooCommerce, however, since the site is working in production with the same plugins/theme and doesn't show the same errors it would suggest an issue with the local copy set up.
Have tried:
Checking the SSL/HTTPS, DevKinsta has an SSL/HTTPS option which registers fine in the browser.
Replacing all the URL references in the database and in the WordPress files
Running on:
macOS, Chrome/Safari
Update
It appears to be an issue with the custom theme. Changing the theme to the default shows the payment input fields correctly. I've noticed that the minimum PHP version for DevKinsta is 7.2 whereas the production version is running 7.0. Is there somewhere within the custom theme specifically that I might find the issue?
Just looking at the syntax I believe it has something to do with bootstraps JS
Uncaught TypeError: Cannot read property 'fn' of undefined util.js:56
at util.js:56
at util.js:10
at bootstrap.min.js:6
at bootstrap.min.js:6
Basically the issue on my website is the fact that I'm using a basic login page, when I enter the login page, I cannot return to the homepage without editing the URL to go to Default.aspx, the ReturnURL doesnt actually work and just displays the ReturnUrl in the URL bar.
/Login.aspx?ReturnUrl=%2fAccount%2fChangePassword.aspx
I think its coming from Js order you called.
Jquery must be called first and after that called bootstrap script files.
<script src="assets/js/jquery/jquery-3.3.1.min.js"></script>
<script src="assets/js/bootstrap/bootstrap.bundle.min.js"></script>
I am editing a codeIgniter application purchased online which have no support, everything is OK but javascript codes are not working, it keeps giving this error message
Error in event handler: TypeError: Cannot read property 'apply' of undefined
at w.g.P (chrome-extension://ngpampappnmepgilojfohadhhmbhlaek/content.js:22:354)
at w.g.na (chrome-extension://ngpampappnmepgilojfohadhhmbhlaek/content.js:4:214)
and when continue viewing the page it says
content.js:21 Uncaught Error: Attempting to use a disconnected port object
at w.g.ka (content.js:21)
But actually in my directories I don't see the page named content.js
How can I solve this error? and finally have my javascript functions working?
Thank you.
Thank you so much for contribution, I came to realize that problem was on my script arrangement, JavaScript had to start at the top of the page, so my problem solved by uninstalling IDM plugin from chrome and re-arranging the script.
I migrated to the live server. This is running ISS v8.5. Now i have multiple problems that are related to js files. Which weren't there in the testing environment.
Since i copied the wordpress 4.8 website and fixed all the files and linkings i noticed the following problems:
visual composer backend editor wont show, and clicking the backend editor button does nothing. (javascript function). Front-end live editor is working.
in the frontend my (woocommerce) productpage is showing product-pictures in a new page instead of replacing the main/featured product-picture. (slideshow javascript function)
The datepicker addon for contact form 7 is not working either. It just shows a input field but on click a date-selector will not appear.
Most of the js is working great though. And all of it was working great in my linux testing environment. Am i missing something here?? I think its related due to the server settings (ISS 8.5 php 5.5)
Problems in inspector:
jquery.flexslider-min.js?ver=5.2:6 Uncaught SyntaxError: Unexpected identifier
photoswipe.min.js?ver=4.1.1:4 Uncaught SyntaxError: Invalid or unexpected token
jquery-ui-timepicker-nl.js:4 Uncaught TypeError: Cannot read property 'regional' of undefined
www.dab-scooters.nl/:639 Uncaught TypeError: $(...).datetimepicker is not a function
recently, I'm getting very strange error using the libraries XAJAX. Everything seems to work correctly, but Chrome console gives me an error every time I run any element.
The page where I is happening is this:
http://es.woow360.com/
For example clicking on any tab business that appears in the search box it does is load a new panoramic generates this error:
Uncaught TypeError: Object #<Text> has no method 'getBoundingClientRect'
WombatUtils.getElementRect
M
U
Y
CrossbrowserMutationObserver.n
d.callbackWrapper
xajax.dom.assign xajax_core.js:210
(anonymous function) xajax_core.js:318
xajax.command.handler.call xajax_core.js:315
xajax.executeCommand xajax_core.js:404
xajax.tools.queue.process xajax_core.js:150
xajax.responseProcessor.xml xajax_core.js:165
xajax.responseReceived xajax_core.js:399
oRequest.request.onreadystatechange xajax_core.js:356
Here you have the link to the file where error occurs:
http://es.woow360.com/xajax/xajax_js/xajax_core.js
It's very strange. Until recently it worked fine.
But now fails.
It fails only on this page, also I have other pages that use the same library, and gives the same error.
Even in other domains, where I have loaded the library XAJAX gives the same error.
Not to be that.
The strange thing is that except for the error message, everything works fine.
Any idea?
Thank you!
I've got the same errors/warnings. Add-less chrome extension was the issue. Try to review extensions of your chrome.