Closed Siri311 closed 4 years ago
@Siri311 can you clarify what version you are on?
@compulim can you take a look and comment?
Is this just a typo in this post, or is this incorrect in your code as well? id:this.props.context.pageContext.user.Eamil
Aside from that, this is essentially what I have setup and working:
public render(): React.ReactElement<IBotWebPartProps> {
//Current User information from Context
var user = { id: this.props.context.pageContext.user.email, name: this.props.context.pageContext.user.displayName };
const { directLink, store } = this.state;
return (
<div className={styles.botFrameworkChat} style={{ height: 500 }}>
<ReactWebChat directLine={directLink} store={store} userID={user.id} username={user.name} />
</div>
);
}
"@microsoft/sp-core-library": "1.9.1",
"@microsoft/sp-lodash-subset": "1.9.1",
"@microsoft/sp-office-ui-fabric-core": "1.9.1",
"@microsoft/sp-webpart-base": "1.9.1",
"@pnp/common": "^1.3.11",
"@pnp/logging": "^1.3.11",
"@pnp/odata": "^1.3.11",
"@pnp/sp": "^1.3.11",
"@types/es6-promise": "0.0.33",
"@types/react": "16.8.8",
"@types/react-dom": "16.8.3",
"@types/webpack-env": "1.13.1",
"botframework-directlinejs": "^0.12.0",
"botframework-webchat": "^4.8.0",
"office-ui-fabric-react": "6.189.2",
"react": "16.8.5",
"react-dom": "16.8.5",
"xhr2": "^0.2.0"
constructor(props) { super(props); this.state = { directLine: createDirectLine({ domain:'<>', secret: "<>", webSocket:true }), store:createStore({},function(_ref){ const dispatch = _ref.dispatch; return function (next) { return function (action) { if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY') {
}
if (action.type === 'DIRECT_LINE/DISCONNECT_FULFILLED') {
//console.log('store: direct line disconnected');
}
if (action.type === 'DIRECT_LINE/CONNECT_FULFILLED') {
console.log('store: direct line connected');
}
return next(action);
};
};
})
};
}
public render(): React.ReactElement
"<"ReactWebChat directline = {this.state.directLine} store={this.state.store} userID={this.user.id} userName={this.user.name}" />"
);
}
TypeError: Cannot read property 'connectionStatus$' of undefined
at connectionStatusToNotification$ (connectionStatusToNotificationSaga.js:24)
at tryCatch (runtime.js:45)
at Generator.invoke [as _invoke] (runtime.js:274)
at Generator.prototype.
Still facing same issue. Please find the attached screenshots. Failed in the middle ware( createStore.ts, connectionStatusNotification.js)
Can you check if this.state.directLine
is undefined
or an object?
connectionStatus$
is retrieved from an object created through createDirectLine
function.
The error stack in your code pointed to this line, https://github.com/microsoft/BotFramework-WebChat/blob/master/packages/core/src/sagas/connectionStatusToNotificationSaga.js#L24.
this.state.directLine is a object, please find the attached screenshot.
There is a typo:
- <ReactWebChat directline = {this.state.directLine} ...
+ <ReactWebChat directLine = {this.state.directLine} ...
Thanks for the quick response. Issue Resolved. Thank You William Wong.
It is not working In IE browser. i found article like below.
Web Chat has no plan to support samples for IE11 (ES5). For customers who wish to manually rewrite our other samples to work in IE11, we recommend looking into converting code from ES6+ to ES5 using polyfills and transpilers like babel.
is there sample to make it work with IE Browser.
Thanks in Advance.
Can you look at this issue, https://github.com/microsoft/BotFramework-WebChat/issues/2511?
As you are on NPM, your code should already target ES5/IE11. Maybe you are missing a few polyfills, as outlined in #2511. (Please vote on the issue if it resolve your problem 😉)
For the article you referenced: to make sample code shorter and easier to read, they are written to be as lean as possible. Thus, we prefer to use latest syntax from latest ES revisions. And developers "downgrade" or transpile them to ES versions they need.
Closing as the main issue is resolved and you have steps needed to get working in IE11.
Description
Created a SPFx web part using react and did the npm install like below npm install --save botframework-webchat npm install --save botframework-directlinejs
After the imported required things and then
Error Details
Thanks in advance