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

TypeError: Cannot read properties of undefined (reading 'endsWith')

Open wangweizm opened this issue 3 years ago • 8 comments

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

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

描述 Bug

pnpm server运行后出现下面的报错 failed to load config from /Users/edy/Desktop/work/template-admin-v3/vite.config.ts error when starting dev server: TypeError: Cannot read properties of undefined (reading 'endsWith') at configHtmlPlugin (/Users/edy/Desktop/work/template-admin-v3/vite.config.ts:385:34) at createVitePlugins (/Users/edy/Desktop/work/template-admin-v3/vite.config.ts:685:20) at vite_config_default (/Users/edy/Desktop/work/template-admin-v3/vite.config.ts:762:14) at loadConfigFromFile (/Users/edy/Desktop/work/template-admin-v3/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-a5ab6d86.js:72020:15) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async resolveConfig (/Users/edy/Desktop/work/template-admin-v3/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-a5ab6d86.js:71546:28) at async createServer (/Users/edy/Desktop/work/template-admin-v3/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-a5ab6d86.js:57128:20) at async CAC. (/Users/edy/Desktop/work/template-admin-v3/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/cli.js:688:24)  ELIFECYCLE  Command failed with exit code 1.

复现 Bug

请描述在演示页面中复现 Bug 的详细步骤,以确保我们可以理解并定位问题。部分 Bug 如果未在 Demo 中涉及,请务必提供关键代码

系统信息

  • 操作系统:
  • Node 版本:v12.20.0
  • 包管理器 (npm/yarn/pnpm) 及其版本:6.28.0

wangweizm avatar Jan 26 '22 09:01 wangweizm

node版本有点低了 16+试试

wangxiaoer5200 avatar Feb 08 '22 02:02 wangxiaoer5200

一样出现了上面的问题 操作系统: mac 10.13.13 Node 版本:v16.14.0 npm:8.5.3 pnpm: 6.32.2

kasnet avatar Mar 04 '22 03:03 kasnet

一样出现了上面的问题 操作系统: mac 10.13.13 Node 版本:v16.14.0 npm:8.5.3 pnpm: 6.32.2

if you can run the project correctly. but when you delete the .env.development file or ignored by the .gitignore file then you will find the truth that you meet this error

yanleidecuojue avatar May 05 '22 03:05 yanleidecuojue

same question。 操作系统: mac 12.5 Node 版本:v16.16.0 npm:8.15.1

maoAmanda avatar Aug 01 '22 03:08 maoAmanda

一样出现了上面的问题 操作系统: mac 12.0.1 Node 版本:v16.14.0 npm:8.5.3 有人解决了吗?

CreatoCode avatar Aug 12 '22 19:08 CreatoCode

是因为根目录下的隐藏文件都被删除了导致的。像.env.development、.gitignore等文件

CreatoCode avatar Aug 12 '22 19:08 CreatoCode

是因为根目录下的隐藏文件都被删除了导致的。像.env.development、.gitignore 等文件

感谢

yangye230147961 avatar Aug 26 '22 07:08 yangye230147961

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 Apr 26 '24 01:04 anncwb