-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
根据官网的教程,通过 import G6 from @antv/g6
报错
Module '"/node_modules/@antv/g6/lib/index"' has no default export
版本号如下
npm list @antv/g6
frontend/
└── @antv/[email protected]
╰─❯ npm list vue
frontend/
├─┬ @vitejs/[email protected]
│ └── [email protected] deduped
├─┬ @vitejs/[email protected]
│ └── [email protected] deduped
├─┬ @vue/[email protected]
│ ├─┬ @vue/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @vuelidate/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @vuelidate/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └─┬ @vuetify/[email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├── [email protected]
└─┬ [email protected]
└── [email protected] deduped
之后通过下面的issue暂时修复了。
Please update vite to latest version(2.8.x at present)
node-resolve plugin is covered by vite, and you don't need add this plugin
commonjs plugin is included in vite, you can set operation in build.commonjsoptions
But it can't fix another issue, I also have the issue #3284 when I build my project by vite(rollup).
If anyone has the same problem, maybe would fix by setting config like this :
// vite.config.ts { resolve: { alias: [ { find: /^@antv\/g6/, replacement: path.resolve( __dirname, './node_modules/@antv/g6/dist/g6.min.js', ), }, ] } }
And this could help me solve my production build...
Originally posted by @luxferrew in #2961
想问下官方,使用Vue3+Vite,这个bug还没修复吗?