【问题标题】:I got an error while running dist file in nestjs project, please help me在nestjs项目中运行dist文件时出错,请帮助我
【发布时间】:2021-10-02 01:12:14
【问题描述】:
(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.

【问题讨论】:

    标签: node.js typescript graphql backend nestjs


    【解决方案1】:

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

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

    【讨论】:

    • 非常好,非常感谢!
    猜你喜欢
    • 2021-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-30
    • 2021-12-26
    • 2012-11-12
    相关资源
    最近更新 更多