question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]: Regression build after upgrade to Angular 10 (Module not found: Error: Recursion in resolving)

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/cli

Is this a regression?

Yes, because our projects with Angular 8, 9 correct works

Description

We use a shared directory to node modules on disk (for improved sharing space on CI).

.yarnrc (for our ng8, ng9 apps)

--modules-folder /var/tmp/yarn/ng10/node_modules/
--cache-folder /var/tmp/yarn/cache/

Therefore, we refer to modules via a symlink:

package.json (for our ng8, ng9 apps)

"scripts": {
    "preinstall": "mkdir -p /var/tmp/yarn/ng10/node_modules/ && rm -f node_modules",
    "postinstall": "ln -s /var/tmp/yarn/ng10/node_modules/ node_modules && yarn ngcc --async"
}

But after upgrade to Angular 10, everything stop working. Now it is required that the node_modules directory was created locally. Is this a bug angular compiler?

🔬 Minimal Reproduction

https://github.com/splincode/ng-10-build-failed

git clone https://github.com/splincode/ng-10-build-failed.git
cd ng-10-build-failed
yarn install
yarn build

# not working

🔥 Exception or Error


$ ng build --prod

ERROR in /private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015/common.js
Module not found: Error: Recursion in resolving
Stack:
  resolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015) @angular/core
  newResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015) @angular/core
  parsedResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015) @angular/core module
  describedResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015) @angular/core module
  rawModule: (/private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015) @angular/core
  module: (/private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015) @angular/core
  resolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  newResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  parsedResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  describedResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  relative: (/private/var/tmp/yarn/ng10/node_modules/@angular/core) 
  describedRelative: (/private/var/tmp/yarn/ng10/node_modules/@angular/core) 
  rawFile: (/Users/splincode/ng-10-build-failed/node_modules/@angular/core) 
  file: (/Users/splincode/ng-10-build-failed/node_modules/@angular/core) 
  relative: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
  describedRelative: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
  rawFile: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
  file: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
 @ /private/var/tmp/yarn/ng10/node_modules/@angular/common/fesm2015/common.js 6:0-548 14:0-40 51:35-49 56:43-61 60:11-19 68:47-61 141:123-138 142:50-68 149:39-47 225:43-61 230:21-29 231:36-44 256:40-54 300:114-129 300:149-164 301:47-72 354:114-129 354:149-164 355:47-72 362:32-44 503:78-93 503:113-128 532:35-53 536:24-32 536:52-60 913:11-26 913:35-51 927:17-32 929:13-29 929:54-70 947:17-32 948:27-43 948:62-78 965:17-32 966:29-45 966:66-82 983:17-32 984:26-42 999:17-32 1000:16-32 1012:17-32 1013:16-32 1027:17-32 1028:36-52 1042:17-32 1043:36-52 1057:17-32 1058:36-52 1072:17-32 1073:21-37 1076:24-40 1079:24-40 1120:17-32 1121:16-32 1135:17-32 1136:16-32 1149:17-32 1150:16-32 1163:11-33 1172:17-32 1173:16-32 1179:28-48 1181:14-30 1182:74-90 1209:17-32 1211:23-39 1237:17-32 1240:13-29 1241:13-29 1254:17-32 1255:16-32 2440:114-129 2440:130-139 2441:47-72 2460:11-30 2505:20-39 2542:101-111 2593:75-99 2593:100-122 2593:125-149 2593:150-172 2593:175-199 2593:200-217 2593:220-244 2593:245-261 2594:33-57 2613:60-71 2621:35-59 2631:105-129 2631:130-153 2632:43-67 2632:382-409 2701:16-25 2796:75-99 2796:100-123 2796:126-150 2796:151-169 2796:172-196 2796:197-219 2797:33-57 2877:66-90 2877:91-114 2877:117-141 2877:142-160 2878:30-54 2893:76-86 2974:34-58 2991:90-114 2991:115-138 2991:141-165 2991:166-184 2991:187-211 2992:38-62 3001:99-123 3001:124-147 3001:150-174 3001:175-193 3001:196-220 3002:41-65 3035:78-102 3036:34-58 3047:90-114 3047:132-156 3047:157-175 3047:178-202 3047:203-226 3047:229-253 3048:38-62 3090:75-99 3090:100-117 3090:120-144 3090:145-167 3090:170-194 3090:195-211 3091:33-57 3159:102-126 3159:127-150 3160:42-66 3160:249-276 3195:62-72 3264:16-26 3267:16-29 3285:81-117 3286:36-55 3304:40-59 3331:40-59 3349:40-59 3381:78-102 3381:103-112 3382:35-54 3415:96-120 3416:41-60 3442:41-60 3455:35-54 3493:90-114 3493:115-137 3494:39-58 3560:87-111 3560:112-121 3561:38-57 3598:87-111 3598:112-121 3599:38-57 3669:90-114 3669:115-124 3669:127-151 3669:152-173 3670:39-58 3704:36-55 3735:38-61 3736:38-61 3741:80-105 3791:34-41 3798:43-61 3801:51-59 3801:79-87 3801:88-100
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in /private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015/platform-browser.js
Module not found: Error: Recursion in resolving
Stack:
  resolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/common
  newResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/common
  parsedResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/common module
  describedResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/common module
  rawModule: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/common
  module: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/common
  resolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/common
  newResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/common
  parsedResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/common
  describedResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/common
  relative: (/private/var/tmp/yarn/ng10/node_modules/@angular/common) 
  describedRelative: (/private/var/tmp/yarn/ng10/node_modules/@angular/common) 
  rawFile: (/Users/splincode/ng-10-build-failed/node_modules/@angular/common) 
  file: (/Users/splincode/ng-10-build-failed/node_modules/@angular/common) 
  relative: (/var/tmp/yarn/ng10/node_modules/@angular/common) 
  describedRelative: (/var/tmp/yarn/ng10/node_modules/@angular/common) 
  rawFile: (/var/tmp/yarn/ng10/node_modules/@angular/common) 
  file: (/var/tmp/yarn/ng10/node_modules/@angular/common) 
 @ /private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015/platform-browser.js 6:0-140 8:0-42 8:0-42 23:39-50 56:8-26 150:15-32 190:24-31 201:30-38 257:12-19 429:23-30 488:50-57 491:127-135 805:115-123 997:130-138 1015:15-23 1117:23-30 1194:115-123 1228:45-53 1288:118-126 1311:13-33 1315:15-23 1319:64-72 1344:15-23 1346:85-93 1355:74-82 1387:229-241 1390:154-166 1402:29-37 1408:24-31 1530:82-90 1545:30-38 1566:85-93 1624:22-29 1626:32-39 1630:20-27 1800:263-271 1855:8-15
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in /private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015/platform-browser.js
Module not found: Error: Recursion in resolving
Stack:
  resolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/core
  newResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/core
  parsedResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/core module
  describedResolve: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/core module
  rawModule: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/core
  module: (/private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015) @angular/core
  resolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  newResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  parsedResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  describedResolve: (/private/var/tmp/yarn/ng10/node_modules) ./@angular/core
  relative: (/private/var/tmp/yarn/ng10/node_modules/@angular/core) 
  describedRelative: (/private/var/tmp/yarn/ng10/node_modules/@angular/core) 
  rawFile: (/Users/splincode/ng-10-build-failed/node_modules/@angular/core) 
  file: (/Users/splincode/ng-10-build-failed/node_modules/@angular/core) 
  relative: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
  describedRelative: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
  rawFile: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
  file: (/var/tmp/yarn/ng10/node_modules/@angular/core) 
 @ /private/var/tmp/yarn/ng10/node_modules/@angular/platform-browser/fesm2015/platform-browser.js 7:0-40 9:0-817 39:8-15 40:15-22 184:40-54 189:21-42 199:17-32 201:40-48 214:8-28 217:8-15 224:8-15 225:8-15 227:34-41 241:13-20 242:12-19 244:8-15 291:19-26 291:35-42 303:22-36 304:14-20 315:11-26 338:17-32 341:13-25 341:45-53 359:48-62 420:90-105 420:130-145 420:146-159 421:39-64 458:43-68 491:111-126 492:46-71 569:21-38 578:21-38 579:21-38 594:111-126 594:142-157 594:180-195 594:196-202 595:46-71 691:20-39 692:58-77 699:20-39 754:40-57 805:99-114 806:42-67 863:48-62 869:40-54 914:46-71 997:114-129 997:141-156 997:181-196 997:197-212 997:215-230 998:47-72 1015:48-56 1015:77-85 1023:38-61 1024:38-61 1194:99-114 1195:42-67 1224:39-57 1224:110-118 1240:21-36 1242:21-36 1243:24-56 1244:31-47 1246:27-41 1247:21-36 1248:24-56 1249:31-47 1252:21-36 1253:24-56 1254:31-47 1257:21-36 1258:33-59 1259:24-56 1260:31-47 1262:27-40 1263:21-36 1264:24-56 1265:31-47 1273:19-47 1276:19-48 1279:19-49 1282:19-46 1285:19-54 1288:102-117 1289:43-61 1289:142-150 1289:151-159 1304:15-27 1308:4-16 1313:15-26 1314:15-35 1318:15-24 1335:38-59 1335:60-72 1338:15-30 1339:15-27 1344:25-31 1344:33-44 1351:50-56 1353:15-31 1356:15-26 1356:38-49 1356:58-64 1357:83-89 1379:31-37 1380:59-65 1386:39-62 1387:39-62 1387:142-157 1387:243-260 1390:80-105 1390:168-185 1402:20-28 1530:66-81 1531:31-49 1545:21-29 1566:69-84 1567:32-50 1597:39-53 1778:40-65 1799:52-75 1800:52-75 1800:273-279 1879:34-41
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in chunk main [initial]
main-es2015.dbdc255ac6553d529b37.js
/private/var/tmp/yarn/ng10/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js??ref--17-0!/private/var/tmp/yarn/ng10/node_modules/@ngtools/webpack/src/index.js!/Users/splincode/ng-10-build-failed/src/main.ts 5500d9d44ce09c64f76d3623cf73acd6
Unexpected token (25:39)
|  * can introduce XSS risks.
|  */
| class GenericBrowserDomAdapter extends !(function webpackMissingModule() { var e = new Error("Cannot find module '@angular/common'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()) {
|     constructor() {
|         super();
SyntaxError: /private/var/tmp/yarn/ng10/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js??ref--17-0!/private/var/tmp/yarn/ng10/node_modules/@ngtools/webpack/src/index.js!/Users/splincode/ng-10-build-failed/src/main.ts 5500d9d44ce09c64f76d3623cf73acd6
Unexpected token (25:39)
|  * can introduce XSS risks.
|  */
| class GenericBrowserDomAdapter extends !(function webpackMissingModule() { var e = new Error("Cannot find module '@angular/common'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()) {
|     constructor() {
|         super();
    at Parser.pp$4.raise (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:2825:15)
    at Parser.pp.unexpected (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:689:10)
    at Parser.pp$3.parseExprAtom (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:2270:12)
    at Parser.pp$3.parseExprSubscripts (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:2089:21)
    at Parser.pp$1.parseClassSuper (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:1404:55)
    at Parser.pp$1.parseClass (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:1309:10)
    at Parser.pp$1.parseStatement (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:833:19)
    at Parser.pp$1.parseTopLevel (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:746:23)
    at Parser.parse (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:553:17)
    at Function.parse (/private/var/tmp/yarn/ng10/node_modules/acorn/dist/acorn.js:576:37)
    at Function.parse (/private/var/tmp/yarn/ng10/node_modules/webpack/lib/Parser.js:2409:22)
    at ConcatenatedModule.source (/private/var/tmp/yarn/ng10/node_modules/webpack/lib/optimize/ConcatenatedModule.js:716:19)
    at ModuleTemplate.render (/private/var/tmp/yarn/ng10/node_modules/webpack/lib/ModuleTemplate.js:54:32)
    at /private/var/tmp/yarn/ng10/node_modules/webpack/lib/Template.js:233:28
    at Array.map (<anonymous>)
    at Function.renderChunkModules (/private/var/tmp/yarn/ng10/node_modules/webpack/lib/Template.js:230:30)

🌍 Your Environment

Angular Version:

Angular 10.0.14

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JoostKcommented, Sep 1, 2020

@alan-agius4 Updating the repro to 10.1 does indeed resolve it 😃

1reaction
alan-agius4commented, Sep 1, 2020

Indeed this looks like a duplicate of https://github.com/angular/angular-cli/issues/18396 which should be solved in 10.1.

Can you try updating to the latest 10.1 prerelease version and try again?

ng update @angular/cli —-next
Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Recursion in resolving in angular app
I found the argument --preserveSymlinks when passed to ng test (that is where I am seeing the error) will break the recursion (fix)...
Read more >
Module not found: Error: Recursion in resolving - jQWidgets
Hi, Im new to jqwidgets, currently Im using jqwidgets-ng, I have created an Angular app using the npm package create-jqwidgets-angular-app ...
Read more >
Bug listing with status CONFIRMED as at 2022/12/20 18:46:38
There is no server at all: it only relies on end-users' machines. ... Bug:109263 - "delny python module" status:CONFIRMED resolution: severity:normal ...
Read more >
Changelog | Meteor API Docs
PR; Throw error when user is not found on Accounts. ... Fix regression on build speed by updating babel dependencies to 7.17.x; We...
Read more >
PyCharm 182.2574.7 Release Notes - Confluence - JetBrains
Bug, PY-28341, Module attribute missing from auto-complete after assigning it to another value ... Feature, IDEA-191726, Update JaCoCo to support Java 10.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found