Closed johannschopplich closed 3 years ago
Relative library import still doesn't work for me
[vite] Internal server error: Failed to resolve import ".entry.js". Does the file exist?
Plugin: vite:import-analysis
File: /Users/maks/Projects/revo-vite/vite-project/node_modules/.vite/@revolist_revogrid_loader.js?v=d36e8090
1519| return o[r];
1520| }
1521| return import("./" + a + ".entry.js").then(function(e2)
The library has relative reference which vite can't read.
import VGrid from "@revolist/vue3-datagrid";
defineComponent({
VGrid
})
vite version: 2.0.0-beta.64 Operating System: macOS Catalina Node version: 15.3.0 Package manager (npm/yarn/pnpm) and version: npm 7.0.14
⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
Describe the bug
Dynamic imports with variables have been working in Vite 1. In the latest version of Vite 2 errors are thrown in development mode — Vite seems unable to find the related file, although path's are correct. Building the app works fine.
The following code generates the routes:
Vite displays error messages like:
Regular imports work just fine:
I think some suffix is missing. Vite calls
/views/Home.vue?import
and cuts off everything after "import". It probably should look similar to/src/views/Default.vue?vue&type=style&index=0&scoped=true&lang.css
.Thanks in advance for taking a look!
Reproduction
git clone git@github.com:johannschopplich/kirby-vue3-starterkit.git
npm install
npm run dev
localhost:3000
System Info
vite
version: 2.0.0-beta.15Logs (Optional if provided reproduction)