Hi @MOUSSAOUI Mohammed ,
Welcome to Q&A forum!
According to the information you provided, the error message is customized by you and the specific reason cannot be determined. According to my research, the mode: 'no-cors'
is likely causing issues, as it prevents the browser from accessing the response data for security reasons. Also, SharePoint APIs can sometimes be tricky due to CORS (Cross-Origin Resource Sharing) restrictions.
Here's a revised approach to help you solve the problem:
- Remove
mode: 'no-cors'
: This setting prevents you from accessing the response content. - Use a Proxy: If CORS is causing issues, you might need to use a proxy server or set up CORS in your SharePoint. However, using a proxy is often not recommended due to security concerns.
- I found a similar post for your reference:
Good day!
If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.