Linda Zhou Thanks for posting your question in Microsoft Q&A. From the stack trace above, this error occurs when calling askForSecrets function. As per the code logic, the console error Could not get 'editorData' from the search params of the URL
first occurred in this line when trying to get search params from URL http://localhost:3000/
and then followed by exception Secrets send by Dev Portal are invalid
in this line. The URL didn't have any search params like editorData
and hence the exception occurred.
This appears to be happening in your local environment and suggest you pass the valid search params (query string) when calling the URL and debug the JavaScript if in case of any other errors or exception.
Also note, this function may return undefined
value when logged in as anonymous in the portal. I hope this helps and let me know if any questions.