I clone this source from GitHub and deploy to azure cloud, but when I run cmd "azd up" it was shown the error as below.
Here are my code:
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#OpenAIOpenAICustomKBappfrontendsrcindex.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:UserslocnsoAppDataLocalTempazd-prepackage-825251035.ps1'. : exit code: 1
I google it but I newbie in node.js so I don’t know what does the error message mean?
2
Answers
This issue had fixed. The reason is in my folder path contains special character '#' so it cause this error.
I had reproduced by deploying frontend application from GitHub to App service via Azure portal check the below steps.
Then click on create the application which is in github repository will be directly deployed into the app service.
You can check the deployment status in the portal or directly in the GitHub actions.
Deployment status:
Also please check the Failed prepackaging service for more information.