Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » pickadayBundle.js - causing JS error in frontend on cart on 9.1.6

pickadayBundle.js - causing JS error in frontend on cart on 9.1.6

Kevin Steffer
Kevin Steffer
Reply

We have disovered that we get this output on the cart

<script type="text/javascript" src="/Admin/Resources/js/layout/pickadayBundle.js"></script>

The script causes an error

Uncaught TypeError: Cannot read property 'parentNode' of null
    at fixPikaWrapperPositionInDOM (pickadayBundle.js:1066)
    at pickadayBundle.js:1076

Because:

function fixPikaWrapperPositionInDOM() {
    var wrapper = document.getElementById("pika-wrapper");
    var parent = wrapper.parentNode;

in our case we don't have a "pika-wrapper"-element and since you just access wrapper.parentNode without null-check somebody in your office might owe a round of beers on Friday wink

Fix

function fixPikaWrapperPositionInDOM() {
    var wrapper = document.getElementById("pika-wrapper");
    if (wrapper != null) {
        var parent = wrapper.parentNode;

 


Replies

 
Nicolai Pedersen
Reply

We could get really drunk if that is how mistakes should excused laugh

This sounds more like it should not even be in the frontend. Do you have a custom orderfield of type DateTime in the solution?

 
Kevin Steffer
Kevin Steffer
Reply

No we have 4 ordersfield of type Text(255) and no Orderlinefields

 

You must be logged in to post in the forum