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
With typescript module resolution set to node next, need to import typescript files with the js extension. This seems to behave fine in normal typescript files, but when combined with an alias and inside a vue component I am receiving a vite:dep-scan error being unable to find the file since it is looking for the js file instead of the typescript one. i.e. (src/Foo.js instead of src/Foo.ts). Note this only happens on a cold start and not entirely sure if it is breaking anything besides showing the error
[ERROR] [plugin vite:dep-scan] ENOENT: no such file or directory, open '/home/kalvens/open-source/vite-vue-nodenext-resolution/src/composables/Test.js'
node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:981:33:
981 │ let result = await callback2({
_ ^
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at file:///home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/vite@3.0.2_sass@1.53.0/node_modules/vite/dist/node/chunks/dep-1513d487.js:36073:37
at callback (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:981:34)
at handleRequest (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:709:36)
at handleIncomingPacket (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:756:7)
at Socket.readFromStdout (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:632:7)
at Socket.emit (node:events:526:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
This error came from the "onLoad" callback registered here:
node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:843:22:
843 │ let promise = setup({
_ ^
at setup (file:///home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/vite@3.0.2_sass@1.53.0/node_modules/vite/dist/node/chunks/dep-1513d487.js:36069:19)
at handlePlugins (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:843:23)
at Object.buildOrServe (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:1137:7)
at /home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:2085:17
at new Promise (<anonymous>)
at Object.build (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:2084:14)
at build (/home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:1931:51)
at file:///home/kalvens/open-source/vite-vue-nodenext-resolution/node_modules/.pnpm/vite@3.0.2_sass@1.53.0/node_modules/vite/dist/node/chunks/dep-1513d487.js:35773:46
at Array.map (<anonymous>)
The plugin "vite:dep-scan" was triggered by this import
script:/home/kalvens/open-source/vite-vue-nodenext-resolution/src/App.vue?id=0:6:17:
6 │ import Test from "@/composables/Test.js";
_ ~~~~~~~~~~~~~~~~~~~~~~~
Build failed with 1 error:
node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:981:33: ERROR: [plugin: vite:dep-scan] ENOENT: no such file or directory, open '/home/kalvens/open-source/vite-vue-nodenext-resolution/src/composables/Test.js'
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
With typescript module resolution set to node next, need to import typescript files with the js extension. This seems to behave fine in normal typescript files, but when combined with an alias and inside a vue component I am receiving a vite:dep-scan error being unable to find the file since it is looking for the js file instead of the typescript one. i.e. (src/Foo.js instead of src/Foo.ts). Note this only happens on a cold start and not entirely sure if it is breaking anything besides showing the error
Reproduction
https://github.com/RtVision/vite3-alias-dep-scan-repro
System Info
Used Package Manager
pnpm
Logs
[ERROR] [plugin vite:dep-scan] ENOENT: no such file or directory, open '/home/kalvens/open-source/vite-vue-nodenext-resolution/src/composables/Test.js'
This error came from the "onLoad" callback registered here:
The plugin "vite:dep-scan" was triggered by this import
Build failed with 1 error:
node_modules/.pnpm/esbuild@0.14.49/node_modules/esbuild/lib/main.js:981:33: ERROR: [plugin: vite:dep-scan] ENOENT: no such file or directory, open '/home/kalvens/open-source/vite-vue-nodenext-resolution/src/composables/Test.js'
Validations
The text was updated successfully, but these errors were encountered: