Kubessandra / react-google-calendar-api

An api to manage your google calendar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ApiCalendar.handleAuthClick() returns undefined

zohrefarzam opened this issue · comments

hello thanks for your great work
i was using this library almost 3 month ago and it worked fine but now when i want to use it i canstantlly get this error
Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'getAuthInstance')

if anyone can help me that would be great

Hello, could you show me your code ?

TypeError: undefined is not an object (evaluating 'react_google_calendar_api__WEBPACK_IMPORTED_MODULE_2___default.a.handleAuthClick().then')

Code:

ApiCalendar.handleAuthClick()
.then(() => {
console.log('sign in succesful!');
})
.catch((e) => {
console.error(sign in failed ${e});
})

Hello,
Before the v1.5.0, handleAuthClick was not returning a promise, if you upgrade the package to 1.5.0 does it solve your issue ?
npm install --save react-google-calendar-api@latest

Hello @Kubessandra ,
Before the v1.5.0, handleAuthClick was not returning a promise,

after doing the installation as mentioned above.
npm install --save react-google-calendar-api@latest

it still don't return any promise

App.js:130 Uncaught TypeError: Cannot read properties of undefined (reading 'then') at handleClick (App.js:130:1) at HTMLUnknownElement.callCallback (react-dom.development.js:188:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:237:1) at invokeGuardedCallback (react-dom.development.js:292:1) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:306:1) at executeDispatch (react-dom.development.js:389:1) at executeDispatchesInOrder (react-dom.development.js:414:1) at executeDispatchesAndRelease (react-dom.development.js:3278:1) at executeDispatchesAndReleaseTopLevel (react-dom.development.js:3287:1) at forEachAccumulated (react-dom.development.js:3259:1) at runEventsInBatch (react-dom.development.js:3304:1) at runExtractedPluginEventsInBatch (react-dom.development.js:3514:1) at handleTopLevel (react-dom.development.js:3558:1) at batchedEventUpdates$1 (react-dom.development.js:21871:1) at batchedEventUpdates (react-dom.development.js:795:1) at dispatchEventForLegacyPluginEventSystem (react-dom.development.js:3568:1) at attemptToDispatchEvent (react-dom.development.js:4267:1) at dispatchEvent (react-dom.development.js:4189:1) at unstable_runWithPriority (scheduler.development.js:653:1) at runWithPriority$1 (react-dom.development.js:11039:1) at discreteUpdates$1 (react-dom.development.js:21887:1) at discreteUpdates (react-dom.development.js:806:1) at dispatchDiscreteEvent (react-dom.development.js:4168:1)

Uncaught ReferenceError: process is not defined at Object.4043 (<anonymous>:2:13168) at r (<anonymous>:2:306599) at Object.8048 (<anonymous>:2:9496) at r (<anonymous>:2:306599) at Object.8641 (<anonymous>:2:1379) at r (<anonymous>:2:306599) at <anonymous>:2:315627 at <anonymous>:2:324225 at <anonymous>:2:324229 at HTMLIFrameElement.e.onload (index.js:1:1)

I will try to check this today, normaly tonight the build will be up and running.

The build for the js file was incorrect I just pushed a new version v1.5.1 you can try this version normally everything will be good.

After v1.5.1

Failed to compile
./components/Main/CalendarsPage/NewCalendar.js:6
Module not found: Can't resolve 'react-google-calendar-api'

6 | import ApiCalendar from 'react-google-calendar-api';

Thanks, will look into this tonight.

@mauryabip normally fixed with the v1.5.2, thanks for using the package.