-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Failed to resolve import. Does the file exist? since 5.1.0-beta.4 (5.1.0-beta.3 was fine) #15784
Comments
|
I guess it may be related to the path cache. Try adding the following configuration. server: {
fs: {
cachedChecks: false
}
} |
That indeed seems related. Adding that in |
had the same issue with |
Have the same issue in |
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Describe the bug
Since
5.1.0-beta.4
I get Failed to resolve import. Does the file exist? on a new folder/file even though they exist.You can replicate the issue by coping a folder that is part of a
import.meta.glob
. However, I think I have ran into this issue multiple times without using import.meta.glob.Note: In
<= 5.1.0-beta.3
the issue was not present.Reproduction
https://stackblitz.com/edit/vitejs-vite-m9sunu?file=package.json&terminal=dev
Steps to reproduce
To reproduce. Open a terminal in stackblitz copy the Test folder:
cp src/Test src/Test2 -r
When you create these folders and files by hand it seems fine.
5.1.0-beta.4 (here things break)
https://stackblitz.com/edit/vitejs-vite-m9sunu?file=package.json&terminal=dev
5.1.0-beta.3 (here things work fine)
https://stackblitz.com/edit/vitejs-vite-qzv2h4?file=src%2FApp.tsx&terminal=dev
System Info
Used Package Manager
npm
Logs
1:49:08 [vite] Internal server error: Failed to resolve import "../Test2/Test/Messages/en.ts" from "src/Intl/en.ts". Does the file exist?
Plugin: vite:import-analysis
File: /home/projects/vitejs-vite-adxel4/src/Intl/en.ts:1:74
1 | import * as __vite_glob_0_0 from "../Test/Messages/en.ts";import * as __vite_glob_0_1 from "../Test2/Messages/en.ts";import * as __vite_glob_0_2 from "../Test2/Test/Messages/en.ts";import * as __vite_glob_0_3 from "../Test3/Messages/en.ts";import * as __vite_glob_0_4 from "../Test4/Messages/en.ts";import * as __vite_glob_0_5 from "../Test5/Messages/en.ts";import * as __vite_glob_0_6 from "../Test6/Messages/en.ts";import * as __vite_glob_0_7 from "../Test7/Messages/en.ts";import * as __vite_glob_0_8 from "../Test8/Messages/en.ts";const imports = /* #PURE */ Object.assign({"../Test/Messages/en.ts": __vite_glob_0_0,"../Test2/Messages/en.ts": __vite_glob_0_1,"../Test2/Test/Messages/en.ts": __vite_glob_0_2,"../Test3/Messages/en.ts": __vite_glob_0_3,"../Test4/Messages/en.ts": __vite_glob_0_4,"../Test5/Messages/en.ts": __vite_glob_0_5,"../Test6/Messages/en.ts": __vite_glob_0_6,"../Test7/Messages/en.ts": __vite_glob_0_7,"../Test8/Messages/en.ts": __vite_glob_0_8});
| ^
2 | export default Object.values(imports).map((mod) => mod.default);
3 |
at formatError (/home/projects/vitejs-vite-adxel4/node_modules/.pnpm/vite@5.1.0-beta.4/node_modules/vite/dist/node/chunks/dep-2l_yqaZo.js:50468:46)
at TransformContext.error (/home/projects/vitejs-vite-adxel4/node_modules/.pnpm/vite@5.1.0-beta.4/node_modules/vite/dist/node/chunks/dep-2l_yqaZo.js:50462:19)
at normalizeUrl (/home/projects/vitejs-vite-adxel4/node_modules/.pnpm/vite@5.1.0-beta.4/node_modules/vite/dist/node/chunks/dep-2l_yqaZo.js:65340:33)
at async eval (/home/projects/vitejs-vite-adxel4/node_modules/.pnpm/vite@5.1.0-beta.4/node_modules/vite/dist/node/chunks/dep-2l_yqaZo.js:65494:47)
at async TransformContext.transform (/home/projects/vitejs-vite-adxel4/node_modules/.pnpm/vite@5.1.0-beta.4/node_modules/vite/dist/node/chunks/dep-2l_yqaZo.js:65415:13)
at async Object.transform (/home/projects/vitejs-vite-adxel4/node_modules/.pnpm/vite@5.1.0-beta.4/node_modules/vite/dist/node/chunks/dep-2l_yqaZo.js:50777:30)
at async loadAndTransform (/home/projects/vitejs-vite-adxel4/node_modules/.pnpm/vite@5.1.0-beta.4/node_modules/vite/dist/node/chunks/dep-2l_yqaZo.js:53533:29)
11:49:08 [vite] Pre-transform error: Failed to resolve import "../Test2/Test/Messages/en.ts" from "src/Intl/en.ts". Does the file exist?
Validations
The text was updated successfully, but these errors were encountered: