gpt4 book ai didi

javascript - 汇总错误: Could not resolve "./pages/layout/Layout" from "src/index.tsx"

转载 作者:行者123 更新时间:2023-12-03 01:13:19 25 4
gpt4 key购买 nike

我从 GitHub 克隆此源并部署到 azure 云,但是当我运行 cmd“azd up”时,显示如下错误。这是我的代码:

import ReactDOM from 'react-dom/client';
import { createHashRouter, RouterProvider } from 'react-router-dom';
import { initializeIcons } from '@fluentui/react';

import './index.css';

import Layout from './pages/layout/Layout';
import Chat from './pages/chat/Chat';

initializeIcons();

const router = createHashRouter([
{
path: "/",
element: <Layout />,
children: [
{
index: true,
element: <Chat />
},
{
path: "qa",
lazy: () => import('./pages/oneshot/OneShot')
},
{
path: "*",
lazy: () => import('./pages/NoPage')
}
]
}
]);

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>
);
Could not resolve "./pages/layout/Layout" from "src/index.tsx"
file: D:\C#\OpenAI\OpenAICustomKB\app\frontend\src\index.tsx
error during build:
RollupError: Could not resolve "./pages/layout/Layout" from "src/index.tsx"
at error (file:///D:/C%23/OpenAI/OpenAICustomKB/app/frontend/node_modules/rollup/dist/es/shared/node-entry.js:2245:30)
at ModuleLoader.handleInvalidResolvedId (file:///D:/C%23/OpenAI/OpenAICustomKB/app/frontend/node_modules/rollup/dist/es/shared/node-entry.js:24650:24)
at file:///D:/C%23/OpenAI/OpenAICustomKB/app/frontend/node_modules/rollup/dist/es/shared/node-entry.js:24612:26
(x) Failed: Packaging service backend

ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: 'C:\Users\locnso\AppData\Local\Temp\azd-prepackage-825251035.ps1'. : exit code: 1

enter image description here

我用谷歌搜索了一下,但我是node.js新手,所以我不知道错误消息是什么意思?

最佳答案

ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '1', Path: 'C:\Users\locnso\AppData\Local\Temp\azd-prepackage-825251035.ps1'. : exit code: 1

  • 大多数情况下,您遇到的错误是指定的文件或路径不存在或无法访问,然后您会发现此错误。检查此链接了解更多信息info .

我通过 Azure 门户将前端应用程序从 GitHub 部署到应用程序服务来进行复制,请检查以下步骤。

  • 登录到 Azure 门户并单击“创建应用服务”并提供具体详细信息,然后在第二部分之后进行部署,您需要指定 GitHub 存储库详细信息,如下所示。

enter image description here

  • 您可以在部署前通过点击预览来检查工作流程。

enter image description here

  • 然后点击创建应用程序,该应用程序位于github存储库中,将直接部署到应用服务中。

  • 您可以在门户中或直接在 GitHub 操作中检查部署状态。

部署状态:

enter image description here

另请检查Failed prepackaging service了解更多信息。

关于javascript - 汇总错误: Could not resolve "./pages/layout/Layout" from "src/index.tsx",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76684402/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com