speed-measure-webpack-plugin icon indicating copy to clipboard operation
speed-measure-webpack-plugin copied to clipboard

Cannot read property 'hash' of undefined

Open hxfdarling opened this issue 6 years ago • 18 comments

"html-webpack-plugin": "^4.0.0-beta.2",

get error:

Failed to compile:

TypeError: Cannot read property 'hash' of undefined

  • compiler.js:292 childCompiler.compileTemplates.then [imt]/[html-webpack-plugin]/lib/compiler.js:292:30

  • next_tick.js:68 process._tickCallback internal/process/next_tick.js:68:7

  • loader.js:745 Function.Module.runMain internal/modules/cjs/loader.js:745:11

  • node.js:279 startup internal/bootstrap/node.js:279:19

  • node.js:752 bootstrapNodeJSCore internal/bootstrap/node.js:752:3

hxfdarling avatar Nov 06 '18 07:11 hxfdarling

Just encountered the same error

atdiff avatar Nov 14 '18 23:11 atdiff

With "html-webpack-plugin": "^4.0.0-beta.5", issue remains same.

xeho91 avatar Dec 14 '18 06:12 xeho91

Related issue in native repo - html-webpack-plugin

chulanovskyi avatar Dec 27 '18 11:12 chulanovskyi

I suspect the issue may be linked to this other issue with html-webpack-plugin

stephencookdev avatar Dec 27 '18 15:12 stephencookdev

A temporary solution, temporarily ignore the detection of HtmlWebpackPlugin

const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");

const smp = new SpeedMeasurePlugin();

const config = smp.wrap({
  mode: 'production',
  entry: [paths.appIndexJs],
  output:{ // omitting},
  plugins:[
    // new HtmlWebpackPlugin({ // omitting}), // remove
    MyPlugin(), // omitting
  ]
})

config.plugins.unshift(
  new HtmlWebpackPlugin({ // omitting }),
)

module.exports = config

Grewer avatar Jan 21 '19 03:01 Grewer

I meet the same error with "html-webpack-plugin": "^4.0.0-beta.5". How to solve?

xiaomaer avatar Apr 21 '19 16:04 xiaomaer

Greetings guys,

First, thank you for the awesome plugin. Very helpful.

Any updates regarding this issue?

geekox86 avatar Aug 30 '19 15:08 geekox86

A temporary solution, temporarily ignore the detection of HtmlWebpackPlugin

const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");

const smp = new SpeedMeasurePlugin();

const config = smp.wrap({
  mode: 'production',
  entry: [paths.appIndexJs],
  output:{ // omitting},
  plugins:[
    // new HtmlWebpackPlugin({ // omitting}), // remove
    MyPlugin(), // omitting
  ]
})

config.plugins.unshift(
  new HtmlWebpackPlugin({ // omitting }),
)

module.exports = config

but when I config link this, there is no result about how much time of the plugin speed

mcfly001 avatar Oct 22 '19 03:10 mcfly001

Any updates on this?

taewonyara avatar Nov 06 '19 10:11 taewonyara

I have meet the same problem, any uodates?

EnjoyChan avatar Jan 14 '20 04:01 EnjoyChan

same here

cfkxzsat avatar Jan 30 '20 12:01 cfkxzsat

same problem here

jzsplk avatar Mar 10 '20 15:03 jzsplk

so I got another issue

URIError: Failed to decode param '/%PUBLIC_URL%/favicon.ico'
    at decodeURIComponent (<anonymous>)

URIError: Failed to decode param '/%PUBLIC_URL%/manifest.json'
    at decodeURIComponent (<anonymous>)

cike8899 avatar Mar 24 '20 09:03 cike8899

http://www.arbaouimehdi.com/how-to-solve-the-cannot-read-property-hash-of-undefined/

kimboender1983 avatar May 12 '20 14:05 kimboender1983

so I got another issue

URIError: Failed to decode param '/%PUBLIC_URL%/favicon.ico'
    at decodeURIComponent (<anonymous>)

URIError: Failed to decode param '/%PUBLIC_URL%/manifest.json'
    at decodeURIComponent (<anonymous>)

same error

gaowujian avatar Jun 18 '20 15:06 gaowujian

see https://github.com/mzgoddard/hard-source-webpack-plugin/issues/416

It might solve your problem

PLQin avatar Jul 17 '20 11:07 PLQin

Same problem. Any solution?

danvln avatar Apr 11 '21 02:04 danvln

same problem any solution?

Spread-More avatar Oct 23 '21 05:10 Spread-More