-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Vite can not resolve path dependencies #6156
Description
Describe the bug
We use Vue 3 with Typescript support, script setup and Swiper 7.3.2 in a project.
In our App, we include Swiper Types. If we want to run vite-ts (2.7.1) the following error occurs:
`Pre-bundling dependencies:
vue
bootstrap
vue3-form-validation
@fortawesome/fontawesome-svg-core
vue-router
(...and 15 more)
(this will be run only when your dependencies or config have changed)
node_modules/swiper/types/index.d.ts:1:14: error: Could not resolve "./shared"
1 │ export * from './shared';
╵ ~~~~~~~~~~
node_modules/swiper/types/index.d.ts:2:34: error: Could not resolve "./swiper-class"
2 │ export { default as Swiper } from './swiper-class';
╵ ~~~~~~~~~~~~~~~~
node_modules/swiper/types/index.d.ts:3:14: error: Could not resolve "./swiper-events"
3 │ export * from './swiper-events';
╵ ~~~~~~~~~~~~~~~~~
node_modules/swiper/types/index.d.ts:4:14: error: Could not resolve "./swiper-options"
4 │ export * from './swiper-options';
╵ ~~~~~~~~~~~~~~~~~~
node_modules/swiper/types/index.d.ts:5:14: error: Could not resolve "./modules/public-api"
5 │ export * from './modules/public-api';
╵ ~~~~~~~~~~~~~~~~~~~~~~
error when starting dev server:
Error: Build failed with 5 errors:
node_modules/swiper/types/index.d.ts:1:14: error: Could not resolve "./shared"
node_modules/swiper/types/index.d.ts:2:34: error: Could not resolve "./swiper-class"
node_modules/swiper/types/index.d.ts:3:14: error: Could not resolve "./swiper-events"
node_modules/swiper/types/index.d.ts:4:14: error: Could not resolve "./swiper-options"
node_modules/swiper/types/index.d.ts:5:14: error: Could not resolve "./modules/public-api"
at failureErrorWithLog (C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:1493:15)
at C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:1151:28
at runOnEndCallbacks (C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:941:63)
at buildResponseToResult (C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:1149:7)
at C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:1258:14
at C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:629:9
at handleIncomingPacket (C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:726:9)
at Socket.readFromStdout (C:\projects\tschingo\vue\node_modules\vite\node_modules\esbuild\lib\main.js:596:7)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)`
Expected Behavior
No problems resolving path.
Reproduction
https://codesandbox.io/s/github/forchel/swiper-test or this repository https://github.com/forchel/swiper-test.git
Project setup: yarn install
Compile: yarn dev or yarn vite
System Info
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
Memory: 47.13 GB / 63.79 GB
Binaries:
Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.1.3 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (94.0.992.31)
Internet Explorer: 11.0.19041.1202Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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 https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.