Source File Not Found in Angular CLI project

后端 未结 11 1384
臣服心动
臣服心动 2021-01-03 17:50

Hi I have this folders in my project But When I run I get this error

Any idea please?

regards

相关标签:
11条回答
  • 2021-01-03 18:08

    I have seen this error with the verifications of Angular 4 onwards.
    You can solve this error like this.

    1. For the execution CTRL+C)
    2. Run or initialize the server (ng serve or npm start);
    0 讨论(0)
  • 2021-01-03 18:09

    Simplest Solution:

    I also had the same issue,

    The file was present in the directory but it was showing the above error.

    Everything was proper but the error was not going.

    then I closed the tab and again went to the directory through command prompt and again started the server:

    ng serve --open
    

    The error went !!!

    0 讨论(0)
  • 2021-01-03 18:10

    i also get this error

    export class Product {
    
    constructor(
      public productname: string,
      public qty: string,
      public price:string
    ) {  }
    

    } this my product.ts file

    solution:

    the error is that i have written productname as product-name or product_name this both things are not allowed so i hope this will help you

    0 讨论(0)
  • 2021-01-03 18:11

    When application is running state and at that if you add a file with some export class then it through this type error

    ERROR in Source file not found: '/C/abc/xyz/pqr/apps/src/app/comm/ab.ts'.

    Solution

    restart application again then it works.

    By using npm start command

    0 讨论(0)
  • 2021-01-03 18:13

    The error suggest that "source file not found".

    This same error I was also getting. In my case by mistake I created a .ts file while ng server was running. The file was not needed so deleted it, from that point I stared getting the error.

    I restore the file again without any code and the error is gone now.

    0 讨论(0)
  • 2021-01-03 18:14

    After execute npm start again all works fine Thanks

    0 讨论(0)
提交回复
热议问题