NativeScript / NativeScript/nativescript-cli

App doesn't build after ns clean

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

还没有人认领这个 Issue。

needs more info
主要语言
JavaScript
星标
1.1k
派生
204
平均合并
1 天 9 小时
30 天内合并 PR
8

描述

Environment

  "dependencies": {
    "@angular/animations": "~11.2.7",
    "@angular/common": "~11.2.7",
    "@angular/compiler": "~11.2.7",
    "@angular/core": "~11.2.7",
    "@angular/forms": "~11.2.7",
    "@angular/platform-browser": "~11.2.7",
    "@angular/platform-browser-dynamic": "~11.2.7",
    "@angular/router": "~11.2.7",
    "@nativescript/angular": "~11.8.0",
    "@nativescript/core": "~8.0.0",
    "@nativescript/theme": "~3.0.1",
    "reflect-metadata": "~0.1.13",
    "rxjs": "^6.6.7",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~11.2.7",
    "@nativescript/android": "8.0.0",
    "@nativescript/ios": "8.0.0",
    "@nativescript/webpack": "5.0.0-beta.2",
    "@ngtools/webpack": "~11.2.6",
    "typescript": "~4.0.0"
  }

Describe the bug
After cleaning the project with ns clean and starting the app again, webpack aborts with the message :

ns debug ios
Searching for devices...
Copying template files...
Platform ios successfully added. v8.0.0
Preparing project...
Compiling @angular/core : module as esm2015
Compiling @angular/animations : module as esm2015
Compiling @angular/animations/browser : module as esm2015
Compiling @angular/common : module as esm2015
Compiling @angular/platform-browser : module as esm2015
Compiling @angular/router : module as esm2015
Compiling @angular/forms : module as esm2015
Compiling @angular/platform-browser/animations : module as esm2015
Compiling @angular/common/http : module as esm2015
Compiling @nativescript/angular : module as esm2015
webpack is watching the files...
./foo/node_modules/@nativescript/webpack/node_modules/webpack/lib/NormalModuleFactory.js:703
				throw new Error(
				      ^
Error: NormalModuleFactory.beforeResolve (angular-compiler) is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created.
    at ./foo/node_modules/@nativescript/webpack/node_modules/webpack/lib/NormalModuleFactory.js:703:11
    at eval (eval at create (./foo/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
Executing webpack failed with exit code 1.

To Reproduce

  1. ns create foo --template @nativescript/template-blank-ng
  2. cd foo
  3. ns debug ios
  4. ctrl-c
  5. ns clean
  6. npm i
  7. ns debug ios

The same goes for Android

Expected behavior
The app starts as expected

贡献指南

打开贡献指南

从这里开始

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

调研方向

在 iOS 或 Android 上,按照列出的 ns createns debugns cleannpm i 顺序复现该失败。阅读报告行附近的 node_modules/@nativescript/webpack/node_modules/webpack/lib/NormalModuleFactory.js,并跟踪调用该 hook 的 angular-compiler 集成。完成标准是应用在两个平台上执行 ns clean 后都能成功启动。

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

评估

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

把新 issue 发到你的邮箱

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