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.

Error: Argument at index 2 of UMD factory call is not a `require` call with a single string argument

See original GitHub issue

Which @angular/* package(s) are the source of the bug?

compiler, upgrade

Is this a regression?

Yes

Description

Hi Team, After upgrade our existing project from angular 12 to 13, It starting throwing error and stucked at generating browser application bundle phase. Please find the error below:

Error: Argument at index 2 of UMD factory call is not a `require` call with a single string argument:
factory(require('@angular/core'),require('@angular/common'),exports, require('@angular/core'), require('perfect-scrollbar'), require('rxjs'), require('rxjs/operators'), require('@angular/common'))
    at getRequiredModulePath (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:3627:11)
    at getImportsOfUmdModule (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:3618:15)
    at UmdDependencyHost.extractImports (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:4085:37)
    at UmdDependencyHost.recursivelyCollectDependencies (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:1459:26)
    at UmdDependencyHost.collectDependencies (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:1445:12)
    at DependencyResolver.getEntryPointWithDependencies (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:3833:12)
    at EntryPointCollector.walkDirectoryForPackages (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:4403:40)
    at EntryPointCollector.walkDirectoryForPackages (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:4423:32)
    at file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:4557:70
    at trackDuration (file:///***/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:4154:18)
(node:12620) UnhandledPromiseRejectionWarning: Error: NGCC failed.
    at NgccProcessor.process (***\node_modules\@ngtools\webpack\src\ngcc_processor.js:146:19)
    at ***\node_modules\@ngtools\webpack\src\ivy\plugin.js:141:27
    at Hook.eval [as call] (eval at create (***\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:24:1)
    at Hook.CALL_DELEGATE [as _call] (***\node_modules\tapable\lib\Hook.js:14:14)
    at Compiler.newCompilation (***\node_modules\webpack\lib\Compiler.js:1054:30)
    at ***\node_modules\webpack\lib\Compiler.js:1099:29
    at eval (eval at create (***\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12620) 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:12620) [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.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:29 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
JoostKcommented, Dec 6, 2021

Likely in this week’s release, on Wednesday/Thursday.

1reaction
innovelteccommented, Dec 8, 2021

I tried to revert my angular packages from v12.2.14 back to v12.2.13 in my nx repo and can confirm that the error is gone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade from Angular 8 to v12 causing "Generating browser ...
I have been working on upgrading an angular app from v8 to v12. I have completed all the upgrade steps by going through...
Read more >
bkimminich/juice-shop - Gitter
I suppose your 32bit architecture is the underlying problem here, but I can't say for sure. If even Docker doesn't work for you,...
Read more >
The starting point for learning TypeScript
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
Read more >
RequireJS API
The function call above specifies two arguments, "cart" and "inventory". These are the modules represented by the "./cart" and "./inventory" module names.
Read more >
Bug descriptions — spotbugs 4.7.3 documentation
This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or...
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