hard-source-webpack-plugin icon indicating copy to clipboard operation
hard-source-webpack-plugin copied to clipboard

Every other production build results in unusable output

Open Nantris opened this issue 7 years ago • 10 comments

Expected Behavior

Every executable from a production build should be usable (In my use case, Electron)

Actual Behavior

Every other production results in an executable which throws: [error] ReferenceError: undefinedresult is not defined

Clearing cache before build results in a guaranteed working executable.

Steps to Reproduce

Unknown - This was not affecting me at all for months, but suddenly this is an issue for me on both Linux and Windows 7. No configuration changes were made to Webpack or babel, but I did start using Yarn workspaces with Lerna.

Operating System, Node, and NPM dependency versions

Linux Mint 19
Windows 7 x64
Node 10.9.0

"devDependencies": {
  "babel-core": "^7",
  "babel-loader": "^8.0.0-beta.4",
  "babel-preset-env": "^7.0.0,
  "css-loader": "^1.0.0",
  "html-webpack-plugin": "^3.2.0",
  "mini-css-extract-plugin": "N/A", (Is this required for proper operation?)
  "style-loader": "^0.22.1",
  "webpack": "^4.17.1",
  "webpack-cli": "^3.1.0"
},
"dependencies": {
  "lodash": "^4.17.11"
}

Nantris avatar Sep 30 '18 17:09 Nantris

Failing builds may be 18kb smaller. Not completely sure about that.

Nantris avatar Sep 30 '18 17:09 Nantris

downgrade to webpack 4.19.0 see #443

dreyks avatar Oct 01 '18 21:10 dreyks

Thanks @dreyks. Is 4.19.1 broken? That's the actual version I have installed.

Nantris avatar Oct 01 '18 21:10 Nantris

webpack is not broken. hardsource is broken when working with webpack 4.19.1 and up

dreyks avatar Oct 01 '18 21:10 dreyks

Thanks very much @dreyks. I'll give 4.19.0 a shot.

Nantris avatar Oct 01 '18 21:10 Nantris

Are there any plans to update this excellent plugin to work with newer versions of Webpack @mzgoddard ?

Nantris avatar Oct 31 '18 17:10 Nantris

More than a year has passed... Any progress on this, or is this project dead?

Connum avatar Aug 06 '19 08:08 Connum

Seems dead. You can still use the plugin in only development to speed things up. Not as good as having it for builds also, but close.

Nantris avatar Aug 16 '19 17:08 Nantris

For those finding this in the future (like me)

I'm pretty sure this was fixed in v0.13.0. (Fixed: https://github.com/mzgoddard/hard-source-webpack-plugin/pull/444 Merged: https://github.com/mzgoddard/hard-source-webpack-plugin/pull/477)

ajaska avatar Sep 05 '19 02:09 ajaska

@ajaska Thanks for the hint 😄 v0.13.0 fixed this error for me

hrafnkellbaldurs avatar Mar 17 '20 20:03 hrafnkellbaldurs