sample-app-aoai-chatGPT
sample-app-aoai-chatGPT copied to clipboard
[fixing an error in deploying] add react-syntax-highlighter to frontend/packages.json.
Motivation and Context
When, I run sh start.sh
on my MacOS terminal, the following error messages were displayed ( The same error occurred when I run azd up
). This can be resolved by installing the appropriate libraries. So, I add the libraries in frontend/packages.json
.
Description
add react-syntax-highlighter and its type in frontend/package.json
to resolve the following error.
run command
> sh start.sh
Error messages
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
System
MacOS
bash
Contribution Checklist
- [x] I have built and tested the code locally and in a deployed app
- [x] For frontend changes, I have pulled the latest code from main, built the frontend, and committed all static files.
- [x] This is a change for all users of this app. No code or asset is specific to my use case or my organization.
- [x] I didn't break any existing functionality :smile: