aurelia / webpack-plugin

A plugin for webpack that enables bundling Aurelia applications.
MIT License
90 stars 36 forks source link

Webpack 5 caching not working (No serializer registered for IncludeDependency/AureliaDependency) #199

Closed glen-84 closed 2 years ago

glen-84 commented 2 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior:

Running a build with the following webpack cache configuration:

        cache: {
            type: "filesystem",
            buildDependencies: {
                config: [__filename]
            }
        }

I get many warnings like:

<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/home/glen/development-environment/Projects/Crew Panel/node_modules/ts-loader/index.js??ruleSet[1].rules[6].use[0]!/home/glen/development-environment/Projects/Crew Panel/src/app/resources/elements/gg-sort-link.ts': No serializer registered for IncludeDependency
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> Array { 16 items } -> IncludeDependency
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/home/glen/development-environment/Projects/Crew Panel/node_modules/ts-loader/index.js??ruleSet[1].rules[6].use[0]!/home/glen/development-environment/Projects/Crew Panel/src/app/view-models/app.ts': No serializer registered for AureliaDependency
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> Array { 182 items } -> AureliaDependency

Expected/desired behavior:

Support for webpack 5 caching / no warnings.

Performance / clean output.

elitastic commented 2 years ago

I've exactly the same problem!

elitastic commented 2 years ago

https://github.com/webpack/changelog-v5/blob/master/guides/persistent-caching.md#serialization

Is this part missing? Do we have to register serialization handlers for au components?

bigopon commented 2 years ago

@elitastic yes it is missing. I wasn't aware of this necessity while migrating. Haven't been able to come back to this yet.