Can't resolve './../$$_gendir/ClientApp/app/app.server.module.ngfactory' #167

Closed
opened 2025-08-09 17:15:15 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @AmrineA on 2/17/2018

I've been battling this error (supposedly related to AOT) even using the newer templates that don't have the include: '/ClientApp' in the webpack.config.js. Here are my steps for reproducing it:

  1. Start with a new template dotnet new angular
  2. Remove jQuery and bootstrap references from the package.json, webpack.config.vendor.js, and boot.browser.ts
  3. Run the following: npm install webpack --config .\webpack.config.vendor.js --env.prod webpack --env.prod
  4. start updating the remaining packages in the package.json to the latest versions
  5. run the commands in step 3 again, and you'll get get the following error:

ERROR in ./ClientApp/boot.server.ts
Module not found: Error: Can't resolve './../$$_gendir/ClientApp/app/app.server.module.ngfactory' in 'C:\Users\xxxxx\Documents\Visual Studio 2017\Projects\testapp2\ClientApp'
@ ./ClientApp/boot.server.ts 8:0-94

ERROR in Error: Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5+
    at throwNotSupportedError (C:\Users\xxx\Documents\Visual Studio 2017\Projects\testapp2\packages\compiler-cli\src\ngtools_api.ts:132:9)
    at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\xxx\Documents\Visual Studio 2017\Projects\testapp2\packages\compiler-cli\src\ngtools_api.ts:80:11)
    at _donePromise.Promise.resolve.then (C:\Users\xxx\Documents\Visual Studio 2017\Projects\testapp2\node_modules\@ngtools\webpack\src\plugin.js:428:58)
    at process._tickCallback (internal/process/next_tick.js:109:7)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:393:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:508:3

Once the error starts, even reverting changes won't make it go away.

*Originally created by @AmrineA on 2/17/2018* I've been battling this error (supposedly related to AOT) even using the newer templates that don't have the `include: '/ClientApp' ` in the webpack.config.js. Here are my steps for reproducing it: 1. Start with a new template `dotnet new angular` 2. Remove jQuery and bootstrap references from the package.json, webpack.config.vendor.js, and boot.browser.ts 3. Run the following: `npm install webpack --config .\webpack.config.vendor.js --env.prod webpack --env.prod` 4. start updating the remaining packages in the package.json to the latest versions 5. run the commands in step 3 again, and you'll get get the following error: ERROR in ./ClientApp/boot.server.ts Module not found: Error: Can't resolve './../$$_gendir/ClientApp/app/app.server.module.ngfactory' in 'C:\Users\xxxxx\Documents\Visual Studio 2017\Projects\testapp2\ClientApp' @ ./ClientApp/boot.server.ts 8:0-94 ERROR in Error: Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5+ at throwNotSupportedError (C:\Users\xxx\Documents\Visual Studio 2017\Projects\testapp2\packages\compiler-cli\src\ngtools_api.ts:132:9) at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\xxx\Documents\Visual Studio 2017\Projects\testapp2\packages\compiler-cli\src\ngtools_api.ts:80:11) at _donePromise.Promise.resolve.then (C:\Users\xxx\Documents\Visual Studio 2017\Projects\testapp2\node_modules\@ngtools\webpack\src\plugin.js:428:58) at process._tickCallback (internal/process/next_tick.js:109:7) at Module.runMain (module.js:606:11) at run (bootstrap_node.js:393:7) at startup (bootstrap_node.js:150:9) at bootstrap_node.js:508:3 Once the error starts, even reverting changes won't make it go away.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#167
No description provided.