我正在尝试使用 React 模板在 Azure API 管理开发人员门户中创建自定义小部件。我无法在本地运行自定义小部件并面临以下错误。
错误:utils.ts:57 无法从 URL 的搜索参数中获取“editorData”: http://localhost:3000/?editorData= SyntaxError: JSON 输入意外结束
代码在 Microsoft 库中失败。
我已关注 Microsoft 的这篇文章,但它并没有帮助解决问题。
从“main.tsx”中删除元素,它将解锁您。 它应该看起来像这样:
<StrictMode>
<WidgetDataProvider>
<App />
</WidgetDataProvider>
</StrictMode>