Error in Vite with G6

1 min read

This solution comes from GitHub User @wooodchen

If you coming up with the error like following picture shows image

Please refer to GitHub Issue #2961.

You should configure two plugins: rollup-plugin-node-rosolve and rollup-plugin-commonjs. The warning will exist but the project will be available.

Configure plugin in vite.config.js:

import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
// ...
export default defineConfig({
  plugin: [
    ...,
    resolve(),
    commonjs(),
    ...
  ]
})