-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LivenessDetect: @smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array. #5057
Comments
I am experiencing the same exact issue after updating my packages. On which framework/platform are you having an issue? Which UI component? How is your app built? What browsers are you seeing the problem on? Which region are you seeing the problem in? Please describe your bug. |
Hi @lwin-kyaw thanks for including all these details. Looking at the |
Hi @esauerbo, thanks for the reply. The below are the implementations of the components. LivenessCheck.tsx // imports
....
Amplify.configure(awsexports);
export default function LivenessCheck({
language = "en",
}: LivenessCheckProps) {
const [livnessResult, setLivenessResult] = useState<AnalysisResult | null>(null);
const [analysisStatus, setAnalysisStatus] = useState<string | undefined>();
const onTryAgain = () => {
setLivenessResult(null);
};
const onCompleteAnalysis = (result: AnalysisResult, error?: string) => {
setLivenessResult(result);
setAnalysisStatus(error);
};
return (
<ThemeProvider>
{livnessResult ? (
<Completion result={livnessResult} onTryAgain={onTryAgain} statusText={analysisStatus} />
) : (
<LivenessAnalysis onCompleteAnalysis={onCompleteAnalysis} language={language} />
)}
</ThemeProvider>
);
} LivenessAnalysis.tsx // Liveness Check Component
export function LivenessAnalysis({ onCompleteAnalysis, language }: ILivenessProps) {
const [loading, setLoading] = useState<boolean>(true);
const [sessionId, setSessionId] = useState<string | null>(null);
const [success, setSuccess] = useState("");
const fetchCreateLiveness = useCallback(async () => {
const response = await fetch(`${LIVENESS_API_ENDPOINT}/create-session`);
const data = (await response.json()) as { sessionId: string };
log.info("json", data);
console.log("json", data);
if (data.sessionId) {
setSessionId(data.sessionId);
} else {
onCompleteAnalysis("Failed", "failed to create liveness-session");
}
setLoading(false);
}, [onCompleteAnalysis]);
useEffect(() => {
fetchCreateLiveness();
}, [fetchCreateLiveness]);
const handleAnalysisComplete = async () => {
if (sessionId) {
const url = `${LIVENESS_API_ENDPOINT}/session-result?sessionId=${sessionId}`;
const response = await fetch(url);
const data = await response.json();
log.info(data);
if (data.response.isLive) {
setSuccess("Liveness check success");
} else {
setSuccess("Liveness check failed");
}
onCompleteAnalysis(data.response.isLive ? "Success" : "Failed");
}
};
const handleOnUserCancel = () => {
log.info("handleOnUserCancel");
onCompleteAnalysis("Cancelled");
};
if (loading || !sessionId) {
return <Loader />;
}
return (
<div>
<FaceLivenessDetector
sessionId={sessionId}
region="ap-south-1"
onAnalysisComplete={handleAnalysisComplete}
onError={(error) => {
log.error(error);
onCompleteAnalysis("Failed", error.error.message);
}}
onUserCancel={handleOnUserCancel}
displayText={livenessDisplayTexts(language)}
/>
<Heading level={2}>{success}</Heading>
</div>
);
} |
I am facing the exact same issue while following these guides from official docs: |
Thanks for reporting this everyone. We have another issue tracking this: #5058 so closing this out as a duplicate. Please see the new issue for a temporary workaround and future updates on a fix. Feel free to comment on that thread with any questions or issues you run into. |
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Liveness
How is your app built?
Webpack 5
What browsers are you seeing the problem on?
Chrome, Firefox, Safari
Which region are you seeing the problem in?
ap-south-1
Please describe your bug.
Hi, I'm not sure whether this is doable or not.
To give you the context, what I'm trying to do is exporting the liveness check react component as a webpack bundle and use it in the other projects.
However, I'm getting this error when using @aws-amplify/ui-react-liveness,
during the liveness analysis (video stream).
The error occurs during the call to the aws
start-face-liveness-session-websocket
session (during the series of light flashes).What's the expected behaviour?
Complete the liveness analysis and get the result from the Liveness session.
Help us reproduce the bug!
Bundle the liveness-check component with webpack 5 and import it to the another project. Start the liveness analysis.
Code Snippet
Exposed class to the other projects
React Component
Console log output
Additional information and screenshots
Relevant deps in package.json
webpack.config.js (I've removed some redundant snippets)
Usage in the other project
The text was updated successfully, but these errors were encountered: