Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev server crashes when rebuilding with image assets in index.html #10

Open
bowd opened this issue Nov 18, 2015 · 0 comments
Open

Dev server crashes when rebuilding with image assets in index.html #10

bowd opened this issue Nov 18, 2015 · 0 comments

Comments

@bowd
Copy link

bowd commented Nov 18, 2015

Description

I have an index.html file that has 3 dependencies:

  1. A favicon file
  2. A logo
  3. the javascript build

When I start the webpack dev server all builds correctly and I get right assets.
If I trigger a save on the index.html file, the webpack dev server crashes with this stacktrace:

/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/webpack/lib/NormalModule.js:136
                var template = dependencyTemplates.get(dep.constructor);
                                                  ^
TypeError: Cannot read property 'get' of null
    at doDep (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/webpack/lib/NormalModule.js:136:37)
    at Array.forEach (native)
    at doBlock (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/webpack/lib/NormalModule.js:151:22)
    at DependenciesBlock.NormalModule.source (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/webpack/lib/NormalModule.js:186:2)
    at __webpack_require__ (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/indexhtml-webpack-plugin/IndexHtmlSource.js:117:39)
    at IndexHtmlSource._getHtmlFromModule (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/indexhtml-webpack-plugin/IndexHtmlSource.js:128:12)
    at IndexHtmlSource.source (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/indexhtml-webpack-plugin/IndexHtmlSource.js:25:21)
    at Compiler.writeOut (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/webpack/lib/Compiler.js:256:26)
    at Compiler.<anonymous> (/Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/webpack/lib/Compiler.js:246:20)
    at /Users/bogdan/workspace/leeruniek/webclient-2.0/node_modules/webpack/node_modules/async/lib/async.js:181:20

If I remove the icon and logo dependencies from the file modifying it doesn't trigger the crash.

How to reproduce

Checkout the repo: https://github.com/bogdan-dumitru/indexhtml-webpack-crash-issue
Install dependencies and run gulp dev to start the dev server on localhost:3000.
Open up the src/index.html file, modify it and save it -- it should result in the crash.

I'm looking into it as well now but any input would be helpful. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant