[DailyProvider] Uncaught TypeError: Cannot read properties of undefined (reading 'call')
Hi folks,
I'm working on a custom implementation using the Daily React library but running into problems with <DailyProvider>
.
I have followed the steps to create a private room using the api and retrieve the room url and access token. In the React app I instantiate the callObject via createCallObject()
and thencallObject.preAuth({url, token})
.
This all appears to be working correctly, and if I inspect the callObject via accessState()
I have access {level: "full"} and meetingState()
returns "loaded".
However when I pass callObject to <DailyProvider callObject={callObject}></DailyProvider>
, the app crashes and I'm getting errors in the console like this one:
Uncaught TypeError: Cannot read properties of undefined (reading 'call')
.
What am I missing?
Best Answer
Answers
-
Hi @jdiz first thing that came to mind is that we recently saw this same error for another user building with Remix, see https://github.com/daily-co/daily-react/issues/19
If this is not what you're building with, could you share more with us about your own build? What version of Daily React are you using? Is there a link for us on which we can try to reproduce?
Thanks!
0 -
Hi Tamara,
Ah yes, I'm building with Remix. Looks like this is the problem.
I'm following the Github issue and will try to follow some of the solutions there.
1 -
Turns out the problem is that Remix requires an outdated rollup-plugin-node-polyfills dependency.
I got this working using npm patch-package, and patching my local copy of events.js to add an
off()
function (as per https://github.com/FredKSchott/rollup-plugin-polyfill-node/blob/v0.11.0/polyfills/events.js#L358-L360).2