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

fs.rmdirSync() deprecated, use rmSync() #502

Closed
wants to merge 1 commit into from
Closed

Conversation

An-GG
Copy link

@An-GG An-GG commented May 19, 2021

We get this warning from puppeteer-extra-plugin-user-data-dir:

(node:52638) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead (Use `node --trace-deprecation ...` to show where the warning was created)

Swaps fse.rmdirSync() with fse.rmSync(), which has identical behavior (both throw error when dir does not exist, both recursively remove subdirectories and files), successfully eliminates warning.

@github-actions github-actions bot added the plugin: puppeteer-extra PuppeteerExtra Plugin related label May 19, 2021
@Niek Niek requested a review from berstend June 16, 2021 20:05
@Maxim-Mazurok
Copy link

LGTM, test failure seems unrelated, I'd rebase/re-run it.

@berstend
Copy link
Owner

Apparently that won't fix the issues some windows users are experiencing:
#421 (comment)

fs.rm(this._userDataDir, { recursive: true, force: true }, console.log)

works on the other hand - closing this PR in favor of a new one with an async method. :)

@berstend berstend closed this Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: puppeteer-extra PuppeteerExtra Plugin related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants