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
if (!response.ok) {
if (response.status === 403) {
throw new Error('Access Forbidden: Token might be invalid or expired.');
} else if (response.status === 404) {
throw new Error('Bot service not found. Check bot URL configuration.');
} else {
throw new Error(`HTTP error! Status: ${response.status}`);
}
}
const conversationInfo = await response.json();
if (window.WebChat && window.WebChat.createDirectLine) {
return window.WebChat.createDirectLine({
token: conversationInfo.token,
domain: `${regionalChannelURL}v3/directline`,
});
} else {
throw new Error('WebChat.createDirectLine is not available. Check the Web Chat library.');
}
} catch (error) {
Log.error('Failed to create DirectLine:', error);
setIsTokenExpired(true); // Show dialog for expired token
throw error; // Pass the error up to the boundary
}
};
Target SharePoint environment
SharePoint Online
Developer environment
None
Browsers
Internet Explorer
Microsoft Edge
Google Chrome
FireFox
Safari
mobile (iOS/iPadOS)
mobile (Android)
not applicable
other (enter in the "Additional environment details" area below)
What version of Node.js is currently installed on your workstation?
18
What version of Node.js is required by the sample?
18
Paste the results of SPFx doctor
Additional environment details
No response
The text was updated successfully, but these errors were encountered:
Disclaimer
Yes
Sample
import { createDirectLine } from 'botframework-webchat';
Contributor(s)
ghost
What happened?
i am Using these Version for SPFx version 1.20.0
For SPFx version 1.20.0, here are the compatible versions of Node.js, React, TypeScript, and other required tools/packages you should install:
Summary of Required Versions:
Tool/Library | Version -- | -- Node.js | 18.x React | 17.x React-DOM | 17.x TypeScript | 4.7.x Gulp | 4.x Fluent UI | 8.x PnP SPFx Controls React | 3.20.0Steps to reproduce
1.If createDirectLine is still not available, double-check your Web Chat library version and dependencies.
2.
3.
Expected behavior
const createDirect = async (botURL: string, regionalChannelURL: string) => {
try {
const response = await fetch(botURL);
} catch (error) {
Log.error('Failed to create DirectLine:', error);
setIsTokenExpired(true); // Show dialog for expired token
throw error; // Pass the error up to the boundary
}
};
Target SharePoint environment
SharePoint Online
Developer environment
None
Browsers
What version of Node.js is currently installed on your workstation?
18
What version of Node.js is required by the sample?
18
Paste the results of SPFx doctor
Additional environment details
No response
The text was updated successfully, but these errors were encountered: