What does this error code mean?

Hi there,
Can some tell me what this error code mean? I have been search wixcode but can not find it.

TypeError: Cannot read property ‘businessName’ of undefined

import wixWindow from 'wix-window';
import wixData from 'wix-data';

//-------------Global Variables-------------//

// Current product's ID. 
let businessName;

//-------------Lightbox Setup-------------//

$w.onReady(function () {
 // Get the data passed by the page that opened the lightbox.
    businessName = wixWindow.lightbox.getContext().businessName; <------------error
 

Hello,

In this case, that error means that the object returned is empty. See if getContext() is actually returning anything.

@icarosadero thank you I was able to fix it with your suggestion

@emsimmons77 I am having the same problem. How did you fix the problem? :slight_smile:

@duncanmaguire My reference field in my Dataset wasn’t set up correctly that is why I was getting the error. I had to change my reference field Id so that is could pull the data over to my lightbox.