Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Hot Module Replacement not working unless entry is main #289

Closed

Description

@sjaase

Exception is thrown in UseWebpackDevMiddleware() when enabling HMR and the webpack config file dosent contain an entry named "main".

Activity

  1. MarkPieszak commented on Sep 1, 2016

    @MarkPieszak
    Contributor

    It looks like there's a marker for this in the aspnet-webpack package actually, you're right.

    // TODO: Stop assuming there's an entry point called 'main'
    if (typeof webpackConfig.entry['main'] === 'string') {
        webpackConfig.entry['main'] = ['webpack-hot-middleware/client', webpackConfig.entry['main']];
    }
    

    And of course the webpack files (default) come with:

    entry: {
        main: ['./ClientApp/boot-client.ts'] // <--
    },
    

    We might need to just dynamically look and see what entry is there, problem I see is if they have multiple entry points in an [] Array. @SteveSandersonMS

  2. hheexx commented on Sep 6, 2016

    @hheexx

    So HMR is broken currently?

    In my app I receive output in console:
    [HMR] bundle rebuilding main.js:720:23
    [HMR] bundle rebuilt in 2900ms main.js:723:8
    [HMR] Checking for updates on the server... main.js:1606:23
    [HMR] Updated modules: main.js:1679:10
    [HMR] - ./ClientApp/styles/style.scss main.js:1681:12
    [HMR] - ./ClientApp/boot-client.ts main.js:1681:12
    [HMR] App is up to date. main.js:1686:10
    Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.

    But the content on the page does not change.

  3. MarkPieszak commented on Sep 6, 2016

    @MarkPieszak
    Contributor

    Do you have the default main entry? @hheexx

    entry: {
        main: ['./ClientApp/boot-client.ts'] // <--
    },
    
  4. hheexx commented on Sep 7, 2016

    @hheexx

    Yes I have.
    I guess it's not this problem.
    When I first read the thread I thought that file needs to be named main.ts

  5. SteveSandersonMS commented on Sep 9, 2016

    @SteveSandersonMS
    Member

    Fixed. To get the fix, update to the latest version of aspnet-webpack (version 1.0.11 or later).

  6. MarkPieszak commented on Sep 9, 2016

    @MarkPieszak
    Contributor

    What did you do to fix it? @SteveSandersonMS just curious!

  7. SteveSandersonMS commented on Sep 9, 2016

    @SteveSandersonMS
    Member
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions