You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to import file from parent directory of package.json. So in tsconfig I have configured to bring import from parent directory of vue project.
But seems vite is unable to bring that file.
I have attached vue project, we can run that project and see the error for reproduction.
[plugin:vite:import-analysis] Failed to resolve import "~shared/test" from "src\App.vue". Does the file exist?
C:/Projects/GitLab/legal-disco-node/client/src/App.vue:4:22
2 | import { RouterLink, RouterView } from "vue-router";
3 | import HelloWorld from "./components/HelloWorld.vue";
4 | import { value } from "~shared/test";
| ^
5 | const _sfc_main = /* @__PURE__ */ _defineComponent({
6 | __name: "App",
at formatError (file:///C:/Projects/GitLab/legal-disco-node/client/node_modules/vite/dist/node/chunks/dep-d29b4e33.js:41170:46)
at TransformContext.error (file:///C:/Projects/GitLab/legal-disco-node/client/node_modules/vite/dist/node/chunks/dep-d29b4e33.js:41166:19)
at normalizeUrl (file:///C:/Projects/GitLab/legal-disco-node/client/node_modules/vite/dist/node/chunks/dep-d29b4e33.js:38034:33)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async TransformContext.transform (file:///C:/Projects/GitLab/legal-disco-node/client/node_modules/vite/dist/node/chunks/dep-d29b4e33.js:38167:47)
at async Object.transform (file:///C:/Projects/GitLab/legal-disco-node/client/node_modules/vite/dist/node/chunks/dep-d29b4e33.js:41419:30)
at async loadAndTransform (file:///C:/Projects/GitLab/legal-disco-node/client/node_modules/vite/dist/node/ch
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
I am trying to import file from parent directory of package.json. So in tsconfig I have configured to bring import from parent directory of vue project.
But seems vite is unable to bring that file.
I have attached vue project, we can run that project and see the error for reproduction.
Then in both the backend and frontend
tsconfig.json
:To allow access to the shared code e.g.:
vite import issue.zip
Reproduction
attached zip file in steps to reproduce
Steps to reproduce
Run
npm install
followed bynpm run dev
vite import issue.zip
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: