ng-toolkit: The file fileName does not exist.

image

I’m using angular cli 6.0.0. The file (./src/app/@app/app.component.ts) does not exist.

my tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ],
    "baseUrl": "src",
    "paths": {
      "@app/*": ["app/*"],
      "@root/*": ["./*"]
    }
  }
}

How to fix?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

I have the same issue. When I run ng add @ng-toolkit/universal it says

ERROR: The file (./src/@app/app.module.ts) does not exist.

In tsconfig.json i have: "paths": { "@app/*": [ "src/app/*" ] }

Same Issue:

ng add @ng-toolkit/universal Installing packages for tooling via npm. INFO: Project property is set to ‘ev’. ERROR: Bootstrap not found in ./src/…/src/app/app.browser.module.ts. ERROR: If you think that this error shouldn’t occur, please fill up bug report here: https://github.com/maciejtreder/ng-toolkit/issues/new INFO: stacktrace has been sent to tracking system. Nothing to be done.

@maciejtreder How to solve this?

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';

import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

import { AppModuleRoutes } from '@app/routes';
import { GeneralModule } from '@app/general-module/general.module';
import { AuthModule } from '@app/auth-module/auth.module';

import { AppHttpInterceptor } from '@app/auth-module/services/http-interceptor.service';

import { AppComponent } from '@app/app.component';
import { DragAndDropModule } from 'angular-draggable-droppable';

/** Обработка локали */
export function HttpLoaderFactory(httpClient: HttpClient) {
  return new TranslateHttpLoader(httpClient, './assets/i18n/', '.json');
}

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    HttpClientModule,
    BrowserModule,
    AppModuleRoutes,
    GeneralModule,
    AuthModule,
    DragAndDropModule.forRoot(),
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    })
  ],
  providers: [
    { provide: HTTP_INTERCEPTORS, useClass: AppHttpInterceptor, multi: true }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }