4

We have a project in Visual Studio Team Services that cannot be built and is having a problem being published. Here are the errors we are getting:

ERROR in ./ClientApp/boot.browser.ts (TaskId:55) 13:58:57.035     1>Module 
not found : error : Can't resolve 
./../$$_gendir/ClientApp/app/app.module.browser.ngfactory' in 
'd:\a\3\s\Axalta.ColorSelector\ClientApp' 
[d:\a\3\s\Axalta.ColorSelector\Axalta.ColorSelector.csproj]
@ ./ClientApp/boot.browser.ts 6:0-95 (TaskId:55)

ERROR in ./ClientApp/boot.server.ts (TaskId:55)
13:58:57.036     1>Module not found : error : Can't resolve 
'./../$$_gendir/ClientApp/app/app.module.server.ngfactory' in 
'd:\a\3\s\Axalta.ColorSelector\ClientApp' 
[d:\a\3\s\Axalta.ColorSelector\Axalta.ColorSelector.csproj]
@ ./ClientApp/boot.server.ts 8:0-94 (TaskId:55)

Here's what's on line 8 of boot.server.ts:

import { AppModule } from './app/app.module.server';

The app.module.server.ts file physically exists but app.module.server.ngfactory does not.

I can get the project to publish locally on my computer.

I did a search and found other instances of this issue being solved by varying the parameters for the npm:

npm install [email protected]

However, I'm running this from VSTS, which uses the following command to publish:

dotnet publish c:\<path> --configuration release --output c:\<path>

Does anyone have any ideas on how to solve this? I appreciate any.

3
  • What's app.module.server.ngfactory used for? Could you reproduce this issue in a new project? You can share a simple project on the OneDrive. Commented Sep 20, 2017 at 3:05
  • I have no idea what app.module.server.ngfactory is used for. It certainly isn't a file I created. I'll try to reproduce this problem on a new minimal project but will need to get permissions to create a new one in VSTS. Commented Sep 22, 2017 at 17:45
  • You can share the detail build log on the OneDrive (Set syste.debug to true), then share the sample project after creating a new project. Commented Sep 25, 2017 at 1:59

2 Answers 2

1

Please check whether your components templateUrl path is correct.If the path is wrong then deployment give you an error like above. And make sure to remove include: /ClientApp/ from the webpack.config.js

@Component({
    selector: 'dynamic-form',
    templateUrl: './dynamic-form.component.html',
    providers: [DynamicControlService]
})
Sign up to request clarification or add additional context in comments.

Comments

0

The vs2017 core 2.0 angular template has a line in the webpack.config.js file:

{ test: /\.ts$/, include: /ClientApp/, use: isDevBuild ? ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] : '@ngtools/webpack' },

The include: /ClientApp/ prevents .ts files generated during publish or release build from being processed by Webpack.

If you remove the include: /ClientApp/ from the webpack.config.js .ts rule test it should work.

1 Comment

I appreciate the answer. I tried what you suggested but am still getting the same error when publishing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.