BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

offsetwidth error when loading the iframe containing the custom ui on another domain

Open Jake1996 opened this issue 8 years ago • 1 comments

botchat.js:sourcemap:12905 Uncaught TypeError: Cannot read property 'offsetWidth' of null at HistoryView.componentDidUpdate (botchat.js:sourcemap:12905) at commitLifeCycles (botchat.js:sourcemap:31662) at commitAllLifeCycles (botchat.js:sourcemap:33325) at HTMLUnknownElement.callCallback (botchat.js:sourcemap:21990) at Object.invokeGuardedCallbackDev (botchat.js:sourcemap:22028) at invokeGuardedCallback (botchat.js:sourcemap:22077) at commitRoot (botchat.js:sourcemap:33464) at completeRoot (botchat.js:sourcemap:34361) at performWorkOnRoot (botchat.js:sourcemap:34311) at performWork (botchat.js:sourcemap:34229) HistoryView.componentDidUpdate @ botchat.js:sourcemap:12905 commitLifeCycles @ botchat.js:sourcemap:31662 commitAllLifeCycles @ botchat.js:sourcemap:33325 callCallback @ botchat.js:sourcemap:21990 invokeGuardedCallbackDev @ botchat.js:sourcemap:22028 invokeGuardedCallback @ botchat.js:sourcemap:22077 commitRoot @ botchat.js:sourcemap:33464 completeRoot @ botchat.js:sourcemap:34361 performWorkOnRoot @ botchat.js:sourcemap:34311 performWork @ botchat.js:sourcemap:34229 performSyncWork @ botchat.js:sourcemap:34206 requestWork @ botchat.js:sourcemap:34106 scheduleWorkImpl @ botchat.js:sourcemap:33981 scheduleWork @ botchat.js:sourcemap:33941 scheduleRootUpdate @ botchat.js:sourcemap:34569 updateContainerAtExpirationTime @ botchat.js:sourcemap:34597 updateContainer @ botchat.js:sourcemap:34616 ReactRoot.render @ botchat.js:sourcemap:37916 (anonymous) @ botchat.js:sourcemap:38335 unbatchedUpdates @ botchat.js:sourcemap:34416 legacyRenderSubtreeIntoContainer @ botchat.js:sourcemap:38331 render @ botchat.js:sourcemap:38399 exports.App @ botchat.js:sourcemap:8594 (anonymous) @ direct:57 botchat.js:sourcemap:31513 The above error occurred in the component: in HistoryView (created by Connect(HistoryView)) in Connect(HistoryView) (created by Chat) in div (created by MessagePaneView) in MessagePaneView (created by Connect(MessagePaneView)) in Connect(MessagePaneView) (created by Chat) in div (created by Chat) in Provider (created by Chat) in Chat (created by AppContainer) in div (created by AppContainer) in AppContainer

Consider adding an error boundary to your tree to customize error handling behavior. Visit https://fb.me/react-error-boundaries to learn more about error boundaries. logCapturedError @ botchat.js:sourcemap:31513 botchat.js:sourcemap:12905 Uncaught TypeError: Cannot read property 'offsetWidth' of null at HistoryView.componentDidUpdate (botchat.js:sourcemap:12905) at commitLifeCycles (botchat.js:sourcemap:31662) at commitAllLifeCycles (botchat.js:sourcemap:33325) at HTMLUnknownElement.callCallback (botchat.js:sourcemap:21990) at Object.invokeGuardedCallbackDev (botchat.js:sourcemap:22028) at invokeGuardedCallback (botchat.js:sourcemap:22077) at commitRoot (botchat.js:sourcemap:33464) at completeRoot (botchat.js:sourcemap:34361) at performWorkOnRoot (botchat.js:sourcemap:34311) at performWork (botchat.js:sourcemap:34229)

This happens when the bot has a custom ui and is deployed through an iframe on another site. The site is an AEM based site

Jake1996 avatar May 31 '18 10:05 Jake1996

Got the solution. Had to use the botchat-es5.js file

Jake1996 avatar Jun 01 '18 11:06 Jake1996