使用egg-script服务器上启动路由文件报错
<!--
如果你是新手，请务必仔细阅读：[如何正确的提出一个 Issue](https://github.com/eggjs/egg/issues/3310)。
感谢您向我们反馈问题，为了高效的解决问题，我们期望你能提供以下信息：
-->

## What happens?
![image](https://user-images.githubusercontent.com/48546899/136642548-711dea22-62a9-4a51-bc3a-6b496e964395.png)
注释这段代码可以启动成功
本地环境启动和访问路由没有任何问题

![image](https://user-images.githubusercontent.com/48546899/136642650-bf628592-aeb6-4e0b-a123-70ba88434ed3.png)
使用tar打包会出现这个错误，打出来的包不完整
## 复现步骤，错误日志以及相关配置

[root@VM-8-11-centos service]# npm run start

> egg-example@1.0.0 start /home/service
> egg-scripts start --daemon

[egg-scripts] Starting egg application at /home/service
[egg-scripts] Run node --no-deprecation /home/service/node_modules/egg-scripts/lib/start-cluster {"baseDir":"/home/service","framework":"/home/service/node_modules/egg","title":"egg-server-egg-example"} --title=egg-server-egg-example
[egg-scripts] Save log file to /root/logs
[egg-scripts] Wait Start: 1...
[egg-scripts] Wait Start: 2...
[egg-scripts] tail -n 100 /root/logs/master-stderr.log
[egg-scripts] Got error when startup: 
[egg-scripts] 2021-10-09 10:58:30,212 ERROR 4501 nodejs.TypeError: Cannot read property 'index' of undefined
[egg-scripts]     at module.exports (/home/service/app/router.js:3:43)
[egg-scripts]     at AppWorkerLoader.loadFile (/home/service/node_modules/egg-core/lib/loader/egg_loader.js:304:13)
[egg-scripts]     at AppWorkerLoader.loadRouter (/home/service/node_modules/egg-core/lib/loader/mixin/router.js:17:10)
[egg-scripts]     at AppWorkerLoader.load (/home/service/node_modules/egg/lib/loader/app_worker_loader.js:43:10)
[egg-scripts]     at new Application (/home/service/node_modules/egg/lib/application.js:66:19)
[egg-scripts]     at Object.<anonymous> (/home/service/node_modules/egg-cluster/lib/app_worker.js:23:9)
[egg-scripts]     at Module._compile (internal/modules/cjs/loader.js:1085:14)
[egg-scripts]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[egg-scripts]     at Module.load (internal/modules/cjs/loader.js:950:32)
[egg-scripts]     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
[egg-scripts] 
[egg-scripts] pid: 4501
[egg-scripts] hostname: VM-8-11-centos
[egg-scripts] 
[egg-scripts] /home/service/node_modules/egg-cluster/lib/app_worker.js:26
[egg-scripts]   throw err;
[egg-scripts]   ^
[egg-scripts] 
[egg-scripts] TypeError: Cannot read property 'index' of undefined
[egg-scripts]     at module.exports (/home/service/app/router.js:3:43)
[egg-scripts]     at AppWorkerLoader.loadFile (/home/service/node_modules/egg-core/lib/loader/egg_loader.js:304:13)
[egg-scripts]     at AppWorkerLoader.loadRouter (/home/service/node_modules/egg-core/lib/loader/mixin/router.js:17:10)
[egg-scripts]     at AppWorkerLoader.load (/home/service/node_modules/egg/lib/loader/app_worker_loader.js:43:10)
[egg-scripts]     at new Application (/home/service/node_modules/egg/lib/application.js:66:19)
[egg-scripts]     at Object.<anonymous> (/home/service/node_modules/egg-cluster/lib/app_worker.js:23:9)
[egg-scripts]     at Module._compile (internal/modules/cjs/loader.js:1085:14)
[egg-scripts]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[egg-scripts]     at Module.load (internal/modules/cjs/loader.js:950:32)
[egg-scripts]     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
[egg-scripts] 2021-10-09 10:58:30,224 ERROR 4483 nodejs.AppWorkerDiedError: [master] app_worker#1:4501 died (code: 1, signal: null, suicide: false, state: dead), current workers: ["2"]
[egg-scripts]     at Master.onAppExit (/home/service/node_modules/egg-cluster/lib/master.js:510:21)
[egg-scripts]     at Master.emit (events.js:400:28)
[egg-scripts]     at Messenger.sendToMaster (/home/service/node_modules/egg-cluster/lib/utils/messenger.js:137:17)
[egg-scripts]     at Messenger.send (/home/service/node_modules/egg-cluster/lib/utils/messenger.js:102:12)
[egg-scripts]     at EventEmitter.<anonymous> (/home/service/node_modules/egg-cluster/lib/master.js:353:22)
[egg-scripts]     at EventEmitter.emit (events.js:412:35)
[egg-scripts]     at ChildProcess.<anonymous> (internal/cluster/master.js:199:13)
[egg-scripts]     at Object.onceWrapper (events.js:520:26)
[egg-scripts]     at ChildProcess.emit (events.js:400:28)
[egg-scripts]     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
[egg-scripts] name: "AppWorkerDiedError"
[egg-scripts] pid: 4483



## 相关环境信息
- **操作系统**：CentOS 8.2 64bit
- **Node 版本**：v14.18.0
- **Egg 版本**：v2.27.0
