vue-vben-admin icon indicating copy to clipboard operation
vue-vben-admin copied to clipboard

Warning 'Use of eval is strongly discouraged' when build, but not found any use of eval

Open guyskk opened this issue 3 years ago • 4 comments

⚠️ 重要 ⚠️ 在进一步操作之前,请检查下列选项。如果您忽视此模板或者没有提供关键信息,您的 Issue 将直接被关闭

  • [x] 已阅读 文档.
  • [x] 确保您的代码已是最新或者所报告的 Bug 在最新版本中可以重现. (部分 Bug 可能已经在最近的代码中修复)
  • [x] 已在 Issues 中搜索了相关的关键词
  • [x] 不是 ant design vue 组件库的 Bug

描述 Bug

执行打包的时候,控制台会打出 'Use of eval is strongly discouraged' 这样的警告信息,但是没有发现哪里用了eval函数。另外,提示的文件似乎是不定的,可能出现在其他地方。

复现 Bug

基于 vue-vben-admin 最新代码 3b3f6c90

➜  vue-vben-admin git:(main) pnpm run build

> [email protected] build /Users/kk/dev/vue-vben-admin
> cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts

vite v2.6.14 building for production...
transforming (4850) src/components/SimpleMenu/src/components/SubMenuItem.vueUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
✓ 4854 modules transformed.

系统信息

  • 操作系统: Mac OS
  • Node 版本: v16.13.0
  • 包管理器 (npm/yarn/pnpm) 及其版本: pnpm 6.22.2

guyskk avatar Nov 16 '21 09:11 guyskk

我也遇到了同样的问题,打包的时候会卡死,请问你解决没

imfuwei avatar Apr 30 '22 06:04 imfuwei

请问你们解决了吗?我这边也遇到这个问题了

Lixiaoshaung avatar Aug 22 '22 07:08 Lixiaoshaung

1669219543659 他这块使用的eval用来支持 a.b.c的方式,可以写成 const value = nestKey.split('.').reduce((out, item) => out[item], values);

yaoyylm avatar Nov 23 '22 16:11 yaoyylm

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

anncwb avatar May 04 '24 01:05 anncwb