Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Angular 18 production build doesn't work with vendor source maps

未关闭
#28,426 5 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
angular, typescript, webpack
领域
build-system

调研方向

从 angular.json 的 sourceMap 配置开始,并使用 production 配置比较文档中记录的 ng serve 和 ng build 命令的输出。使用 Angular CLI 18.1.1 重现 vendor source maps 的 404,然后跟踪 production build 路径,以确定为何会省略 node_modules 中的 map。完成标准是 production build 能够加载 vendor source maps,同时其他 source maps 继续正常工作。

由索引模型根据 Issue 内容生成。

描述

angular/build:application area: @angular/build freq1: low severity3: broken type: bug/fix
Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

Yes

Description

We upgraded our apps from ng17 to 18 and adopted the new build system. In our angular.json file we had options set to enable vendor source maps for production and regular builds. This worked fine prior to the upgrade. Example config below for references as I cannot post details from our work setup.

{
  "projects": {
    "your-project-name": {
      "architect": {
        "build": {
          "options": {
            "sourceMap": {
              "scripts": true,
              "vendor": true
            }
          }
        }
      }
    }
  }
}

So when running ng serve with a production config the source maps for things like RX are debuggable without issue.

ng serve application --open live-reload --configuration=production

However when we run our release jobs using this command we find the disted app does not support loading source maps from node_modules. All other source maps seem to work fine .

ng build application --configuration=production

I looked for a documented change here to see if vendor source maps are still supported in production builds and couldn't find anything about them being deprecated.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw
404 cannot load source map
Please provide the environment you discovered this bug in (run ng version)
Angular CLI Version: 18.1.1
Node Version: 20.11.1
Package Manager: npm 10.2.4
Operating System: win32 x64 (Windows 64-bit)


@angular-devkit/architect: 0.1801.1
@angular-devkit/build-angular: 18.1.1
@angular-devkit/core: 18.1.1
@angular-devkit/schematics: 18.1.1
@schematics/angular: 18.1.1
ng-packagr: 18.1.0
rxjs: 7.8.1
typescript: 5.5.4
webpack: 5.92.1
zone.js: 0.14.3
Anything else?

No response

主要语言
TypeScript
星标
27k
派生
11.8k
平均合并
16 小时 35 分钟
30 天内合并 PR
176

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

angular/angular-cli 的其他 Issue

查看 angular/angular-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。