【问题标题】:The callback was already called - css-loader - Angular回调已被调用 - css-loader - Angular
【发布时间】:2021-12-24 07:20:14
【问题描述】:

我在将项目部署到谷歌云时遇到此错误。它在我的本地端运行良好,但是当我尝试部署项目时它发生了。

步骤#0 - “构建”:[0m[91mCompiling ngx-material-file-input:es2015 作为esm2015

步骤 #0 - “构建”:[0m[91mCompiling ngx-toastr : es2015 as esm2015

步骤 #0 - “构建”: [0m[91m/ng-app/node_modules/loader-runner/lib/LoaderRunner.js:106 步骤#0 - “构建”:抛出新错误(“回调():回调是 已经调用了。");

第 0 步 - “构建”:^

步骤 #0 - “构建”:步骤 #0 - “构建”:错误:回调():回调 已经被调用了。步骤 #0 - “构建”:在 context.callback (/ng-app/node_modules/loader-runner/lib/LoaderRunner.js:106:10)

第 0 步 - “构建”:在 /ng-app/node_modules/@angular-devkit/build-angular/node_modules/css-loader/dist/index.js:137:5

第 0 步 - “构建”:在 processTicksAndRejections (node:internal/process/task_queues:96:5)

第 0 步 - “构建”:

第 0 步 - “构建”:Node.js v17.1.0

步骤 #0 - “构建”:命令 '/bin/sh -c npm run ng build -- --prod --output-path=dist' 返回一个非零代码:1 Finished Step #0 - "Build" ERROR ERROR: build step 0 "gcr.io/cloud-builders/docker" 失败:步骤以非零状态退出:1

第 0 步 - “构建”:[0m

Here is the image

【问题讨论】:

    标签: angular npm node-modules npm-install css-loader


    【解决方案1】:

    我解决了这个问题。问题是打字稿自动更新到最新版本,这增加了角度和打字稿版本之间的冲突,导致 GCP 出现此错误。

    解决方案:在 tsconfig.json 文件中添加这个,然后重试

    "angularCompilerOptions": {
        "disableTypeScriptVersionCheck": true,
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-13
      • 2016-01-26
      • 2018-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-22
      • 2017-03-02
      相关资源
      最近更新 更多