webpack-dev-server: Uncaught TypeError: Cannot read property 'replace' of null
Hi, with version 1.14.1 I’m receiving this error:
Uncaught TypeError: Cannot read property 'replace' of null
I’m using an inline script in the index.html to load the .JS file (which is in the folder declared by publicPath) and I enabled the hot module replacement to receive updates.
Using version 1.14.0, it works fine (so at the moment I am not updating the webpack-dev-server module to 1.14.1).
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 10
- Comments: 22 (1 by maintainers)
Commits related to this issue
- Update dependencies Do not upgrade webpack-dev-server to >=1.14.1 https://github.com/webpack/webpack-dev-server/issues/381 — committed to tofuness/Toshocat by deleted user 8 years ago
- downgrade webpack-dev-server to 1.14.0 because of this bug https://github.com/webpack/webpack-dev-server/issues/381 — committed to dmapper/derby-webpack by cray0000 8 years ago
Same problem here because of the Google Tag Manager script in the index.html
Just to point out for anyone else having the same issue - For me this issue occurred because of using the Poper Blocker chrome extension. I didn’t have no script tag without ‘src’ attribute in the page I was working on, so it was very confusing to understand that this extension injects a script tag (without an ‘src’ attribute) during the page loading.
I have disabled the extension until this issue will be fixed.
Also getting this problem with the similar script injections. The solution provided above (downgrading to 1.14.0) works for me.
I was able to work around this with a hack-ish change:
FYI: This is happening when you have a
<script />
tag in your code that doesn’t have asrc
attribute.