You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Vercel部署NestJS项目遇类型错误及模板文件识别问题

问题排查:NestJS项目Vercel部署异常

背景

我正在开发一个对接各类Google服务的个人休闲项目,main分支上的NodeJS代码在Vercel部署正常,现迁移至NestJS以实现应用扩容。

初始问题

NestJS代码本地运行正常,但在Vercel部署时出现类型错误,可在Vercel日志及部署状态的构建环节查看。推测问题出在tsconfig文件,其代码如下:

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": false,
    "target": "ES6",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "strictBindCallApply": false,
    "forceConsistentCasingInFileNames": false,
    "noFallthroughCasesInSwitch": false,
  }
}

更新1

已大幅修复类型错误,奇怪的是这些类型错误仅在Vercel部署日志中可见。目前仅剩一个问题:Vercel无法识别部署中的*.njk文件。

更新2

已在Vercel官方社区提交关于nunjucks模板未找到的问题讨论。


内容的提问来源于stack exchange,提问作者Mr_Green

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 02:37:07