Skip to content

TypeError: Cannot read properties of undefined (reading 'data') #19

@Udayraj123

Description

@Udayraj123

I was referring to this documentation to test out the lotus typescript package on a self hosted version. But I encountered the following error:

Stack Trace:

index.js:18 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'data')
    at isApiError (index.js:18:1)
    at callReq (index.js:32:1)
    at Lotus.flush (index.js:150:1)
    at index.js:123:1
isApiError	@	index.js:18
callReq	@	index.js:32
flush	@	index.js:150
(anonymous)	@	index.js:123
setTimeout (async)		
enqueue	@	index.js:123
trackEvent	@	index.js:167
onClick	@	index.js:45
handleClick	@	button.js:124
callCallback	@	react-dom.development.js:4164
invokeGuardedCallbackDev	@	react-dom.development.js:4213
invokeGuardedCallback	@	react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError	@	react-dom.development.js:4291
executeDispatch	@	react-dom.development.js:9041
processDispatchQueueItemsInOrder	@	react-dom.development.js:9073
processDispatchQueue	@	react-dom.development.js:9086
dispatchEventsForPlugins	@	react-dom.development.js:9097
(anonymous)	@	react-dom.development.js:9288
batchedUpdates$1	@	react-dom.development.js:26140
batchedUpdates	@	react-dom.development.js:3991
dispatchEventForPluginEventSystem	@	react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay	@	react-dom.development.js:6465
dispatchEvent	@	react-dom.development.js:6457
dispatchDiscreteEvent

The debug point in the source code:
image

Steps to reproduce:

  • Simply called lotus.trackEvent() with http://localhost as the host name

Any help is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions