Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack 5 throws DeprecationWarning #15576

Closed
jensmeindertsma opened this issue Jul 28, 2020 · 7 comments
Closed

Webpack 5 throws DeprecationWarning #15576

jensmeindertsma opened this issue Jul 28, 2020 · 7 comments

Comments

@jensmeindertsma
Copy link

Bug report

Describe the bug

Using Webpack 5 with the official support shipped in Next.js 9.5, Webpack throws a few DeprecationWarnings when I run my app:

[DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
[DEP_WEBPACK_MAIN_TEMPLATE_RENDER_MANIFEST] DeprecationWarning: MainTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)
[DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_MANIFEST] DeprecationWarning: ChunkTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)
[DEP_WEBPACK_MAIN_TEMPLATE_HASH_FOR_CHUNK] DeprecationWarning: MainTemplate.hooks.hashForChunk is deprecated (use JavascriptModulesPlugin.getCompilationHooks().chunkHash instead)
[DEP_WEBPACK_COMPILATION_OPTIMIZE_CHUNK_ASSETS] DeprecationWarning: optimizeChunkAssets is deprecated (use Compilation.hook.processAssets instead and use one of Compilation.PROCESS_ASSETS_STAGE_* as stage option)
[DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.chunks was changed from Array to Set (using Array method 'reduce' is deprecated)
[DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_LENGTH] DeprecationWarning: chunk.files was changed from Array to Set (using Array property 'length' is deprecated)
[DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_INDEXER] DeprecationWarning: chunk.files was changed from Array to Set (indexing Array is deprecated)
[DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
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_*.
[DEP_WEBPACK_MODULE_ID] DeprecationWarning: Module.id: Use new ChunkGraph API
[DEP_WEBPACK_MODULE_UPDATE_HASH] DeprecationWarning: Module.updateHash: Use new ChunkGraph API
[DEP_WEBPACK_CHUNK_MODULES_ITERABLE] DeprecationWarning: Chunk.modulesIterable: Use new ChunkGraph API
[DEP_WEBPACK_CHUNK_GROUP_GET_MODULE_INDEX_2] DeprecationWarning: ChunkGroup.getModuleIndex2 was renamed to getModulePostOrderIndex
[DEP_WEBPACK_EXTERNALS_FUNCTION_PARAMETERS] DeprecationWarning: The externals-function should be defined like ({context, request}, cb) => { ... }

However, the app still runs fine. I just think these should be fixed/hidden.

To Reproduce

Clone the development branch of this repository. These warnings appear in development mode and at build time, I also deployed to Vercel where they showed up as well.

Expected behavior

I would expect there to be no warnings thrown.

System information

  • OS: Windows
  • Browser: Chrome
  • Version of Next.js: 9.5.0
  • Version of Node.js: v12.16.3

Additional context

I tried updating to 9.5.1-canary.0, but now the app won't run. I'll open another issue about this.

@timneutkens
Copy link
Member

Duplicate of #13341, this is expected as per the todo list.

@jensmeindertsma
Copy link
Author

Sorry, did not look carefully enough to find that one!

@timneutkens
Copy link
Member

No worries!

@stefaneidelloth
Copy link

For me the solution was to update "mini-css-extract-plugin" to version "1.3.9"

@igli7
Copy link

igli7 commented Apr 5, 2021

if you're using yarn

Run:
yarn upgrade-interactive --latest

and select all the ones in red, select them with the spacebar and navigate through them with up and down arrow keys.

Hope this helps someone

@hmodykhrtoto

This comment has been minimized.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants