Skip to content

Webpack is not watching my changes in a new directory. #857

Closed

Description

@bfwg

I'm submitting a question about the decisions made in the repository

I create a new directory called services under app:

app/
    services/
        some-service.ts
        index.ts

Added to index.ts

export * from './services';
export * from './app.component';
export * from './app.service';
export * from './app.routes';

import { AppState } from './app.service';

// Application wide providers
export const APP_PROVIDERS = [
  AppState,
];

Every time I make a change in some-service.ts, webpack-dev-server will restart, but the changes will not get picked up.

Only compilation errors not updated on change. Like:

   Property 'callback' does not exist on type '{}'.
   Supplied parameters do not match any signature of call target.

I have to manually shutdown and restart dev-server to recompile.

Activity

  1. IAMtheIAM commented on Aug 26, 2016

    @IAMtheIAM

    Post more of your typescript code as well as full error details for us to diagnose. It's not enough info to give an accurate answer yet. I was able to add a new services directory with no problem.

  2. bfwg commented on Sep 1, 2016

    @bfwg
    Author

    Here is some more code:

    @Component({
      selector: 'test',
      providers: [
      ],
      directives: [],
      pipes: [],
      template: `
        <div class="abc">
           abc
        </div>
      `,
      styles: [
        .abc {
           width: '20%',
           margin: '10px'
        }
      ]
    })

    I worte the styles in a wrong way, and here are the errors.

    [default] /Users/sss/code/asdfkj/src/test.component.ts:19:5
        Expression or comma exected.
    [default] /Users/sss/code/asdfkj/src/test.component.ts:19:6
        Cannot find name 'abc'
    [default] /Users/sss/code/asdfkj/src/test.component.ts:19:10
        ',' expected.
    
    

    I correct it by changing the style to

      styles: [`
        .abc {
          width: '20%';
          margin: '10px;
        }
      `]
    
    

    Webpack pickup my change and reload. But the same errors appear again.
    I only gose away if I ctrl+c stop webpack and restart it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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