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

[del] Some internal modules are deprecated. #209

Open
stein2nd opened this issue May 27, 2024 · 4 comments
Open

[del] Some internal modules are deprecated. #209

stein2nd opened this issue May 27, 2024 · 4 comments

Comments

@stein2nd
Copy link

npm warn deprecated [email protected]:
Rimraf versions prior to v4 are no longer supported
del@4 1 1

npm warn deprecated [email protected]:
Glob versions prior to v9 are no longer supported
rimraf@2 7 1

@timmkuehle
Copy link

timmkuehle commented May 28, 2024

Unfortunately i can add another, seemingly more serious, deprecation to that:

npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.

error

@johnagan Since you still have a huge userbase with nearly 2 million downloads per week, it would be much appreciated if you could fix these dependencies. I could also try to tackle this myself and open a PR, but i sadly have very little spare time at the moment and no experience in working with del which seems to be the root cause of those dependancy issues.

By the way, you're plugin is still working great in all of the projects that I'm using it in (even with webpack 5 and NodeJS 18) and i assume it also does for many others, so it might be worth the effort. Thanks in advance!

@johnagan
Copy link
Owner

I’d be open to reviewing a PR to address it, but it’s unlikely I’ll have time to resolve this myself.

@stein2nd
Copy link
Author

stein2nd commented May 29, 2024

For verification, I temporarily modernised package.json by running 'ncu' and 'ncu -u' under the 'clean-webpack-plugin' installation folder.
@babelpreset-typescript

After running 'npm install --force', several internal modules still show a deprecated warning.

npm warn deprecated [email protected]:
Rimraf versions prior to v4 are no longer supported
temp-sandbox@4 0 1

npm warn deprecated [email protected]:
Glob versions prior to v9 are no longer supported
babel-jest@29 7 0

npm warn deprecated [email protected]:
This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
Pasted Graphic 1

npm warn deprecated [email protected]:
https://about.codecov.io/blog/codecov-uploader-deprecation-plan/
Pasted Graphic 5

npm warn deprecated [email protected]:
Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
codecov@3 8 3

@timmkuehle
Copy link

timmkuehle commented Jun 2, 2024

I'm afraid, I wont be able to solve this issue.

I forked the project and tried to update the del dependency manually. When using the updated package in one of my projects, I get an error, telling me I can't use require() to import an ESM module:

[webpack-cli] Failed to load '~/my-project/Code/webpack.config.js' config
[webpack-cli] Error [ERR_REQUIRE_ESM]: require() of ES Module ~/clean-webpack-plugin/Coding/node_modules/del/index.js from ~/clean-webpack-plugin/Coding/dist/clean-webpack-plugin.js not supported.
Instead change the require of index.js in ~/clean-webpack-plugin/dist/clean-webpack-plugin.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (~/clean-webpack-plugin/dist/clean-webpack-plugin.js:7:12)
    at async WebpackCLI.tryRequireThenImport (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:232:34)
    at async loadConfigByPath (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:1406:27)
    at async WebpackCLI.loadConfig (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:1515:38)
    at async WebpackCLI.createCompiler (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:1781:22)
    at async WebpackCLI.runWebpack (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:1877:20)
    at async Command.<anonymous> (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:944:21)
    at async Command.parseAsync (~/my-project/Code/node_modules/webpack-cli/node_modules/commander/lib/command.js:935:5)
    at async Command.<anonymous> (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:1356:13)
    at async Command.parseAsync (~/my-project/Code/node_modules/webpack-cli/node_modules/commander/lib/command.js:935:5)
    at async WebpackCLI.run (~/my-project/Code/node_modules/webpack-cli/lib/webpack-cli.js:1360:9)
    at async runCLI (~/my-project/Code/node_modules/webpack-cli/lib/bootstrap.js:9:9) {
  code: 'ERR_REQUIRE_ESM'
}

This is caused by the plugin's build system, that transpiles import statements into require() functions. The updated del package does not seem to provide an export that can be used with the require() syntax.

Maybe using a dynamic import() could fix this, but there seems to be no way to use that synchronously, which in turn disqualifies this as an easy fix.

So I guess, the only option to solve this, would be to adjust the whole build system. Sadly i don't have any experience in using @babel/cli, since I always worked with webpack's own cli and I don't really have the time to dig any deeper at this point.

Maybe someone with more experience can help here. Otherwise I think we're stuck with using the plugin in it's current state. This hopefully won't be overly dramatic, since it is only ever used during transpilation and not in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants