Skip to content

Could not find a declaration file for module AppModuleNgFactory #149

@programulya

Description

@programulya

Hi all,

After updating to Angular 6 I have an error with exporting AppModuleNgFactory in main-aot.ts while running build-production:

ERROR in [at-loader] ./angularApp/main-aot.ts:7:36
TS7016: Could not find a declaration file for module './app/app.module.ngfactory'. 'D:/.. app.module.ngfactory.js' implicitly has an 'any' type.
Child html-webpack-plugin for "index.html":
[0] ./~/html-webpack-plugin/lib/loader.js!./angularApp/index.html 627 bytes {0} [built]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! delivery@1.0.0 webpack-production: set NODE_ENV=production && webpack
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the delivery@1.0.0 webpack-production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
...
error Command failed with exit code 2.

My main-aot.ts:

declare var System: any;

import { platformBrowser } from '@angular/platform-browser';
import { enableProdMode } from '@angular/core';
import { AppModuleNgFactory } from './app/app.module.ngfactory';

enableProdMode();

platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);

What do you think what fix could be applied here? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions