# 今天遇到的vue项目开发是一保存就异常终止的问题

{% embed url="<https://v.douyin.com/r8fUU1t/>" %}

{% embed url="<https://www.bilibili.com/video/BV1ce4y1E7JU/>" %}

大家看这个vue项目刚启动起来

没有任何问题

但是呢神奇的地方就在于

我随便在一个页面上保存一下

大家看

就报错了然后项目就停了

然后根据这个报错呢

我在网上搜

也没有找到相关的解决方案哈

就是这个有

但是跟我这个问题不一样

后来呀我就用 删代码 的方式定位到

问题在这个test上面

什么意思呢

就是在这个项目里

这个脚本不能让他mode等于test

只要mode等于test他就报错

给大家看一下我把这改成abc

然后呢把这个都删掉

把下边的脚本都删掉

就留一个ABC然后呢 mode = test

我们再来试一下

ABC

然后呢我点一下保存

大家看 就报错了

但是如果我不让他等于test

比如我换成xiaoshan

大家看

还是ABC

好启动起来了

然后呢我再在这保存一下大家看

这没有问题了

所以就很奇怪对吧

其他项目这样用是没有问题的

后来呢我就在这个cli-service

挨个版本去试了一下

因为他报错里提到了这个sli-service

后来我就发现

他在3.11.

之后的版本都已经解决这个问题了

我们先来试一下把它改成3.11.

然后呢重新按PM

然后呢把这块改回来

然后我们再来启动一下

OK我们再来试一下

哎？

还是报错 （没有底气了）

看一下npm

我们把这个node\_modules删掉

重新试一下

npm install

好再来试一下 run abc

好可以了我们再试一下保存

那至于的报错的真正原因

等我回头研究明白了再给大家分享

现在有的两个线索

一个就是他在3.11.0里面

提交了一个fix

就是这个

不知道他跟这次的BUG有没有关系哈

另一个线索呢

就是他在官方文档里提到了这个mode

等于test的实际上是

用于这个的

所以他可能是一个保留模式（的关键字）

但是呢即便是这样他也不应该报错

那总结一下的话呢

就是如果我们用的这个cli-service啊

低于3.11.0版本

这里啊就不要用test

更好的习惯就是如果用了cli-service

这里都不用test

我们换个名字


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sunzsh.gitbook.io/xiaoshan.bug/jin-tian-yu-dao-de-vue-xiang-mu-kai-fa-shi-yi-bao-cun-jiu-yi-chang-zhong-zhi-de-wen-ti.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
