The easiest method to debug a PDP Widget Implementation implementation is via Chrome’s DevTools, specifically by checking the Console for any error messages, inspecting the network activity for the loading of the JS script and the Complete the Look API call, and checking the DOM for the module’s target DOM container with an ID of findmine-app-container
.
The PDP Widget Implementation Guide details the requirements for a successful implementation. Below is a step-by-step process to make sure the JS is loading correctly and rendering in the correct spot.
findmine
within the Network tab and see if a <app-id>.module.js
request is present.findmine
to find the findmine-app-container
.Uncaught Error: Minified React error #200
; this can also indicate a timing issue (see Common Issues, below)window.FindMine.match({/* params */})
complete-the-look
followed by a variety of query parameterswindow.FindMine.match({/* params */})
call is either not being triggered by the client, or there’s a timing issuewindow.FindMine.match({/* params */})
callwindow.FindMine.match({/* params */})
call that does not exist in the FM systemcomplete-the-look
API call; click on the Response header in the right panel, and read through it. There will usually be an error with a reason
value that specifies what is happening: No match looks, invalid item, etc.
complete-the-look
API is successfully made and returning looks, but the module is still not rendering, check the parameters
return_pdp_item: true
parameter that, if missing, will mean the module does not renderUncaught Error: Minified React error #200
is printed to the console (a timing issue)
Ensure that you have implemented the module using a MutationObserver
. Doing so almost guarantees that all the prerequisites required for the FindMine Widget to load on the page exist and are ready. The MutationObserver
listens for the existence of the target DOM container with specified findmine-app-container
ID in the page’s HTML. Without this container, the FindMine Widget JavaScript will fail to attach to the page and cause the Uncaught Error: Minified React error #200
. Implementations using the MutationObserver
will not run into this issue:
<script>
function loadFindMine() {
var script = document.createElement('script');
script.onload = function () {
// Add any custom scripts to construct parameters object here
// window.FindMine.match call belongs here
window.FindMine.match({
application: '<Application-ID>',
product_id: '<Product-ID>',
product_color_id: '<Product-Color-ID>',
product_in_stock: true,
return_pdp_item: true,
});
};
// Loads client-specific FindMine Widget JS onto your PDP
script.src = '//js.findmine.com/<Application-ID>.module.js';
document.head.appendChild(script);
}
function waitForTargetContainer(params, callback) {
var observer;
observer = new MutationObserver(mutations => {
var target = document.getElementById(params.id);
if (target) {
observer.disconnect();
callback(target);
}
});
observer.observe(document, {
subtree: !!params.recursive,
childList: true,
});
}
// Dynamic mount point integration listens for the existence of the
// target DOM container w/ specified ID
if (!document.querySelector('#findmine-app-container')) {
waitForTargetContainer({
id: 'findmine-app-container',
recursive: true,
}, target => {
// Target DOM container exists; load the widget
loadFindMine();
});
} else {
// Mount point detected (target DOM container exists); load the widget
loadFindMine();
}
</script>
Double check that the target DOM container ID is correct in your implementation.
If you have attempted all of these steps and continue experiencing issues with your implementation, please contact your Customer Experience Manager and we will be happy to provide additional guidance.