liady / webpack-node-externals

Easily exclude node modules in Webpack
MIT License
1.3k stars 62 forks source link

webpack 5 DeprecationWarning: [DEP_WEBPACK_EXTERNALS_FUNCTION_PARAMETERS] #89

Closed stefanpl closed 3 years ago

stefanpl commented 3 years ago

I'm using

    "webpack": "^5.10.1",
    "webpack-node-externals": "^2.5.1"
    "webpack-cli": "^4.2.0"

Despite having taken the actions recommended in the "For Webpack 5" section, I get this warning:

[DEP_WEBPACK_EXTERNALS_FUNCTION_PARAMETERS] DeprecationWarning: The externals-function should be defined like ({context, request}, cb) => { ... }

The warning disappears when not using this module. It works despite the warning (just a deprecation after all …), but should probably be taken care of.

Test repo, in case you want to see for yourself

Honestly, I haven't looked into any of the code, and I'm not at all familiar with webpack's internal workings. If this is could be considered a good first issue though, I'd be inclined to take a look. Not much else going on anyway :grin:

liady commented 3 years ago

Thank you! It seems that upgrading to v2.5.2 should fix it - as seen in this commit

stefanpl commented 3 years ago

Oh wow, thanks @liady . I could have sworn I was using the latest version, sorry for that one 🙈 Next time I'll triple-check …