A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/open-data-plan/g2plot-vue/issues/505 below:

[Bug] 在vite+vue3环境下构建失败 · Issue #505 · open-data-plan/g2plot-vue · GitHub

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem or a mini showcase.

Desktop (please complete the following information):

Additional context
非常高兴能有这个库,我想在我的项目里面使用g2plot,但是并不想自己动手在上层封装一个使用层,这个库刚好解决了这个问题。但是我发现在vite + vue3的环境中(现在很多开发者已经将工程的构建脚手架转移到vite),这个库的构建有一些问题,希望能帮忙查看一下此问题,并创建一个示例demo。

环境:

 "@antv/g2plot": "^2.3.37",
 "@opd/g2plot-vue": "^3.6.0",
 "vue": "^3.2.20",
 "vite": "^2.6.7",

构建报错:

[vite] error while updating dependencies:
  Error: Build failed with 3 errors:
  node_modules/@opd/g2plot-vue/es/components/base.js:1:26: error: Could not resolve "@babel/runtime/helpers/esm/objectSpread2" (mark it as external to exclude it from the bundle)
  node_modules/@opd/g2plot-vue/es/components/base.js:2:37: error: Could not resolve "@babel/runtime/helpers/esm/objectWithoutProperties" (mark it as external to exclude it from the bundle)
  node_modules/@opd/g2plot-vue/es/utils.js:1:26: error: Could not resolve "@babel/runtime/helpers/esm/objectSpread2" (mark it as external to exclude it from the bundle)
      at failureErrorWithLog (E:\水院项目工作空间\smart-water\smart-water-chishui\node_modules\esbuild\lib\main.js:1493:15)
      at E:\水院项目工作空间\smart-water\smart-water-chishui\node_modules\esbuild\lib\main.js:1151:28
      at runOnEndCallbacks (E:\水院项目工作空间\smart-water\smart-water-chishui\node_modules\esbuild\lib\main.js:941:63)
      at buildResponseToResult (E:\水院项目工作空间\smart-water\smart-water-chishui\node_modules\esbuild\lib\main.js:1149:7)
      at E:\水院项目工作空间\smart-water\smart-water-chishui\node_modules\esbuild\lib\main.js:1258:14
      at E:\水院项目工作空间\smart-water\smart-water-chishui\node_modules\esbuild\lib\main.js:629:9

问题猜测:
根据报错我猜测是babel配置的原因,但没有去深入追查。据文档指南,只是引入了@opd/g2plot-vue配置,并未要求配置babel


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4