microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.46k stars 2.21k forks source link

Failed to build frontend : react-uuid@2.0.0 is no longer supported #725

Open chindaku9531 opened 3 months ago

chindaku9531 commented 3 months ago

Describe the bug Failed to build frontend from local with an error "npm WARN deprecated react-uuid@2.0.0: Package no longer supported."

src/components/Answer/Answer.tsx:15:42 - error TS2307: Cannot find module 'react-syntax-highlighter' or its corresponding type declarations. 15 import {Prism as SyntaxHighlighter} from 'react-syntax-highlighter';

src/components/Answer/Answer.tsx:16:22 - error TS2307: Cannot find module 'react-syntax-highlighter/dist/esm/styles/prism' or its corresponding type declarations.
16 import { nord } from 'react-syntax-highlighter/dist/esm/styles/prism';

Found 2 errors in the same file, starting at: src/components/Answer/Answer.tsx:15 Failed to build frontend

To Reproduce Steps to reproduce the behavior:

  1. build the app code with start.cmd from local
  2. the error shows up

Expected behavior Web app should be started successfully.

bsonnek commented 3 months ago

This issue also happens when deploying the app from GitHub Actions. The Answer.tsx file from this commit introduces the issue: https://github.com/microsoft/sample-app-aoai-chatGPT/pull/708

danniesim commented 3 months ago

npm i react-syntax-highlighter and npm i --save-dev @types/react-syntax-highlighter allowed me to build the frontend.

bsonnek commented 3 months ago

https://github.com/microsoft/sample-app-aoai-chatGPT/pull/739/files

This also resolved the issue for me.