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

ReferenceError: serializer is not defined

Open Cyclodex opened this issue 6 years ago • 5 comments

I have the following issue when using it:

ReferenceError: serializer is not defined at info (C:...\node_modules\hard-source-webpack-plugin\lib\CacheSerializerFactory.js:103:22)

It looks like the variable is simply not defined yet, so placing a "var, let or const" seems to fix it...

https://github.com/mzgoddard/hard-source-webpack-plugin/blob/ffe2e641e5a4503b0bd8ed79a82f4716849dba4f/lib/CacheSerializerFactory.js#L103

Cyclodex avatar Sep 28 '18 13:09 Cyclodex

I am having the same issue, is there a work around that?

another-guy avatar Oct 22 '18 19:10 another-guy

I had the same issue, turned out I had broken links to local packages - yarn link <package-name> fixed it.

8eecf0d2 avatar Oct 23 '18 20:10 8eecf0d2

Happend to me too, cause was that i accidentally defined HardSourceWebpackPlugin twice inside the same webpack config.

joma74 avatar Feb 01 '19 09:02 joma74

Happend to me too, cause was that i accidentally defined HardSourceWebpackPlugin twice inside the same webpack config.

defined hard-source and plugin(hard-source-webpack-plugin) at the same time in nuxt.config.js

huoyuxin avatar Jan 07 '20 07:01 huoyuxin

I have the following issue when using it:

ReferenceError: serializer is not defined at info (C:...\node_modules\hard-source-webpack-plugin\lib\CacheSerializerFactory.js:103:22)

It looks like the variable is simply not defined yet, so placing a "var, let or const" seems to fix it...

https://github.com/mzgoddard/hard-source-webpack-plugin/blob/ffe2e641e5a4503b0bd8ed79a82f4716849dba4f/lib/CacheSerializerFactory.js#L103

so,had fixed it now? I' placing a "var" before it, it can be normal now.

ChenKaiKe avatar May 15 '22 06:05 ChenKaiKe