node.js - 我在 nestjs 项目中运行 dist 文件时出错,请帮助我

标签 node.js typescript graphql backend nestjs

(node:8356) UnhandledPromiseRejectionWarning: Error: No type definitions were found with the specified file name patterns: "./**/*.graphql". Please make sure there is at least one file that matches the given patterns.
    at GraphQLTypesLoader.<anonymous> (E:\NestJS\Template_Login\teample-api-backend-nestjs\backend\node_modules\@nestjs\graphql\dist\graphql-types.loader.js:38:23)
    at Generator.next (<anonymous>)
    at fulfilled (E:\NestJS\Template_Login\teample-api-backend-nestjs\backend\node_modules\tslib\tslib.js:114:62)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:8356) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async 
function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8356) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

最佳答案

我遇到了同样的问题。这很可能是由于 .graphql 文件在构建时被忽略并且没有复制到/dist。有趣的是,我以前没有,而且构建似乎完成得很好,它今天才出现。

我找到了解决 NestJS 创建者提出的问题的方法: https://github.com/nestjs/graphql/issues/135

关于node.js - 我在 nestjs 项目中运行 dist 文件时出错,请帮助我,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68524064/

相关文章:

node.js - NodeJS 'appendFile' 未在 Docker 容器中创建文件

javascript - 如何使子应用程序可以访问 session 变量

javascript - tslint - 最后一行缺少尾随逗号 (trailing-comma)

reactjs - react-apollo getClient 未定义

node.js - 测量 websocket 性能的工具

javascript - Flot 不适用于 node.js

javascript - 使用Socket.IO传输的文件对象变成 'ArrayBuffer'?

javascript - Firebase 存储连接到 Angular 应用

graphql - 中继 - dataID.startsWith 不是函数

javascript - 解构 Flow 对象类型?