You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use daily-js in Cordova app and during initial prototyping we got the following error (sorry about the bad formatting)
Object = $1
action: "error"
error: Object
details: Object
bundleUrl: "https://c.daily.co/call-machine/versioned/0.60.0/static/call-machine-object-bundle.js"
on: "load"
sourceError: Error: Failed to load call object bundle https://c.daily.co/call-machine/versioned/0.60.0/static/call-machine-object-bundle.js: TypeError: window.store.getState is not a function. (In 'window.store.getState()', 'window.store.getState' is undefined)
column: 137770
line: 1
message: "Failed to load call object bundle https://c.daily.co/call-machine/versioned/0.60.0/static/call-machine-object-bundle.js: TypeError…"
sourceURL: "https://unpkg.com/@daily-co/[email protected]/dist/daily.js"
stack: "@https://unpkg.com/@daily-co/[email protected]/dist/daily.js:1:137770↵t@https://unpkg.com/@daily-co/[email protected]/dist/daily.js:1:8933…"
Error Prototype
Object Prototype
msg: "Failed to load call object bundle."
type: "connection-error"
Object Prototype
errorMsg: "Failed to load call object bundle https://c.daily.co/call-machine/versioned/0.60.0/static/call-machine-object-bundle.js: TypeError…"
Object Prototype
The error was due to our use of https://www.npmjs.com/package/cordova-plugin-purchase which uses default clobber store. While it was trivial to fix it, it was unexpected and at least to my knowledge undocumented (compared to cordova-plugin-purchase which is well documented). Also it is hard to reason over call-machine-object-bundle.js as it is minified. So far it seems placeDailyContextOnWindow() sets the following global properties
As my current understanding is that call-machine-object-bundle.js is an internal library I would suggest to keep global namespace as less polluted as possible, maybe use double underscore prefix or just a single object, e.g. __dailyjs that holds all needed properties.
Why you need this
This feature will provide better software compatibility.
Alternatives you've considered
Maybe providing a simple documentation what global properties daily-js uses will be enough.
Additional context
The text was updated successfully, but these errors were encountered:
Thank you for the report. We are currently undertaking this very issue and working to remove all dependencies on the window so that these will go away. It is a sizeable project that we hope to have publicly available in the next quarter.
Feature request
We use daily-js in Cordova app and during initial prototyping we got the following error (sorry about the bad formatting)
The error was due to our use of https://www.npmjs.com/package/cordova-plugin-purchase which uses default clobber
store
. While it was trivial to fix it, it was unexpected and at least to my knowledge undocumented (compared to cordova-plugin-purchase which is well documented). Also it is hard to reason over call-machine-object-bundle.js as it is minified. So far it seemsplaceDailyContextOnWindow()
sets the following global propertiesAs my current understanding is that call-machine-object-bundle.js is an internal library I would suggest to keep global namespace as less polluted as possible, maybe use double underscore prefix or just a single object, e.g.
__dailyjs
that holds all needed properties.Why you need this
This feature will provide better software compatibility.
Alternatives you've considered
Maybe providing a simple documentation what global properties daily-js uses will be enough.
Additional context
The text was updated successfully, but these errors were encountered: