pcb icon indicating copy to clipboard operation
pcb copied to clipboard

Problem with Webpack 5.0

Open sergeushenecz opened this issue 5 years ago • 17 comments

Hello everyone. I have some problem when i updating from webpack 4 to 5 version. When i build project i have error in the console.

image

Error in line code. image

sergeushenecz avatar Oct 11 '20 17:10 sergeushenecz

the same issue for me. Some more details: result.resource is undefined. It can be accessed at result.createData.resource but then the following:

Uncaught exception: Error: NormalModuleFactory.afterResolve is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created.

Enase avatar Oct 13 '20 14:10 Enase

@Enase I found an issue https://github.com/webpack/webpack/issues/11647 The same problem. I think plugin not supported the new version webpack.

sergeushenecz avatar Oct 13 '20 14:10 sergeushenecz

@sergeu90 ic, it's true. thanks.

Enase avatar Oct 13 '20 14:10 Enase

@NekR Hello. Are we planning to upgrade to webpack 5?

sergeushenecz avatar Oct 14 '20 06:10 sergeushenecz

Can anyone have experience writing a plugin for webpack? Maybe anyone fork and rewrite this library

sergeushenecz avatar Oct 24 '20 06:10 sergeushenecz

The last release was done about two years ago. I don't believe that we find any help here.

Enase avatar Oct 26 '20 12:10 Enase

Does it mean the plugin is dead? Maybe Are there alternative plugins?

sergeushenecz avatar Oct 26 '20 14:10 sergeushenecz

https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin

gowrav-scienaptic avatar Nov 28 '20 18:11 gowrav-scienaptic

@gowrav-scienaptic Can you explain? Is it alternative plugin?

sergeushenecz avatar Nov 29 '20 15:11 sergeushenecz

@sergeu90, Yes it's an alternative for offline-plugin. You can read the details on how to integrate here.

gowrav-scienaptic avatar Nov 29 '20 18:11 gowrav-scienaptic

We are using offline-plugin and attempting to upgrade to Webpack 5. Should we wait for this issue to be resolved or is this no longer maintained?

timminata avatar Dec 18 '20 12:12 timminata

@timminata plugin author doesn't reply over two years. Unfortunately, the answer is yes.

Enase avatar Dec 18 '20 13:12 Enase

@gowrav-scienaptic Thanks. I migrated to workbox.

sergeushenecz avatar Feb 22 '21 17:02 sergeushenecz

Hello guys ! Our team needs offline-plugin to work with Webpack 5, so we worked on a fix here : https://github.com/NekR/offline-plugin/pull/498

Enjoy :) LCDP,

LeComptoirDesPharmacies avatar May 03 '21 14:05 LeComptoirDesPharmacies

Hello again guys ! Our team forked and worked on a relase candidate that work with Webpack 5, it's available here => https://www.npmjs.com/package/@lcdp/offline-plugin

Any feedback are welcome, we need you to improve the compatibility with webpack 5 !

LeComptoirDesPharmacies avatar May 04 '21 16:05 LeComptoirDesPharmacies

@LeComptoirDesPharmacies Unfortunately it's not possible to create issue in your github repo. There is an issue while webpack build with your implementation:

(node:18736) [DEP_WEBPACK_COMPILATION_CACHE] DeprecationWarning: Compilation.cache was removed in favor of Compilation.getCache()
    at compilationFn (......./node_modules/@lcdp/offline-plugin/lib/service-worker.js:142:25)
    at _next36 (eval at create (......../node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:50:1)
    at _next14 (eval at create (......../node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:97:1)

and

BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
	Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
	Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
    at ServiceWorker.apply (....../node_modules/@lcdp/offline-plugin/lib/service-worker.js:192:35)

Enase avatar May 07 '21 16:05 Enase

@Enase Sorry for this, we have enabled the issues on our repo.

Thank you for your feedback, as we use webpack 5 in production we should fix this depreciation warning before it becomes really breaking.

Do it break your build ?

We have the same warning, but everything works like a charm.

If you see others warnings, don't hesitate to open an issue on our repo, know it's working 💯

Yours faithfully, LCDP

LeComptoirDesPharmacies avatar May 07 '21 16:05 LeComptoirDesPharmacies