marker-io / browser-sdk

Marker.io browser SDK
MIT License
8 stars 8 forks source link

Capture is not a function #25

Closed Jelbert closed 1 year ago

Jelbert commented 1 year ago

Hello, I don't know if this is a bug, I followed the documentation (https://marker.io/blog/integrate-web-app-browser-sdk) and got error. Please help. Thanks

I'm using vuejs 3.

image

const widget = markerSDK.loadWidget({
    project: 'abc1234',

    reporter: {
        email: 'john@clientwebsite.com',
        fullName: 'John Smith',
    },
});

function reportABug(){
      widget.capture()
}
Jelbert commented 1 year ago

SOLVED:

function reportABug(){
    widget.then(value => {
        value.capture();
    });
}
emilevictorportenart commented 1 year ago

Happy to hear you got it solved. We're going to update the documentation to make it clearer!