Failed to resolve imports

Hello, any idea how to fix this? [plugin:vite:import-analysis] Failed to resolve import "./ext-src/DashboardPage.jsx" from "src/router.tsx". Does the file exist? /home/thedude/xauto/.wasp/out/web-app/src/router.tsx:15:30 7 | import LoginPage from './ext-src/pages/auth/Login.jsx'; 8 | import SignupPage from './ext-src/pages/auth/Signup.jsx'; 9 | import { DashboardPage } from './ext-src/DashboardPage.jsx'; | ^ 10 | export const routes = { 11 | LoginRoute: { at formatError (file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:44055:46) at TransformContext.error (file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:44051:19) at normalizeUrl (file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:41837:33) at async file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:41991:47 at async Promise.all (index 8) at async TransformContext.transform (file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:41907:13) at async Object.transform (file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:44345:30) at async loadAndTransform (file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:55015:29) at async viteTransformMiddleware (file:///home/thedude/xauto/.wasp/out/web-app/node_modules/vite/dist/node/chun
3 Replies
matijash
matijash14mo ago
hmm seems it's wrong import - can you share your mage generation (it has the unique url)? might be it is a named import while it should be a global one, so just import DashboardPage from ..., but would be best to see the code
0xthedude
0xthedudeOP14mo ago
https://usemage.ai/result/5e8cbaa5-26cf-42fd-9b6b-50a2868dcee8 i always get failed to resolve import.. tried 3 different
matijash
matijash14mo ago
fix it like this:
route DashboardRoute { path: "/", to: DashboardPage }
page DashboardPage {
component: import { DashboardPage } from "@client/pages/Dashboard.jsx",
authRequired: true
}
route DashboardRoute { path: "/", to: DashboardPage }
page DashboardPage {
component: import { DashboardPage } from "@client/pages/Dashboard.jsx",
authRequired: true
}
Does this help?
Want results from more Discord servers?
Add your server