Skip to content

type="module" on script tag results in "Cannot read property 'webpackHotUpdate' of undefined" when hot reloading is enabled. #1139

Closed
@RDGthree

Description

@RDGthree
  • Operating System: MacOS 10.12
  • Node Version: 8.4.0
  • NPM Version: 5.3.0
  • webpack Version: 3.6.0
  • webpack-dev-server Version: 2.9.1
  • This is a bug
  • This is a feature request
  • This is a modification request

Code

Quick example: https://github.com/RDGthree/webpackHotUpdate-bug-example

Expected Behavior

When using type="module" on script tags, Hot Module Reloading works the same as with type="text/javascript", or has a helpful error.

Actual Behavior

The compiled bundle fails to execute with the error Uncaught TypeError: Cannot read property 'webpackHotUpdate' of undefined.

For Bugs; How can we reproduce the behavior?

Clone the example repo, npm install, and npm run start. Open index.html in a browser and check the console.

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