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

启动 Docusaurus 开发服务器时出现 punycode 模块弃用警告 #82

Open
ywh555hhh opened this issue Oct 8, 2024 · 4 comments
Open
Labels
help wanted Extra attention is needed

Comments

@ywh555hhh
Copy link
Member

问题描述

在运行 yarn start 命令启动 Docusaurus 开发服务器时,出现以下警告信息:

(node:38404) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[INFO] Starting the development server...
[SUCCESS] Docusaurus website is running at: http://localhost:3000/

使用 --trace-deprecation 选项运行命令后,显示了详细的堆栈跟踪信息:

node --trace-deprecation $(yarn bin)/docusaurus start
(node:49996) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:398:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
    at loadBuiltinModule (node:internal/modules/helpers:96:7)
    at Module._load (node:internal/modules/cjs/loader:1063:17)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/Users/yiweihan/Documents/iamProgramer/hust-mirrors/node_modules/fast-url-parser/src/urlparser.js:401:16)
    at Module._compile (node:internal/modules/cjs/loader:1460:14)
[INFO] Starting the development server...
[SUCCESS] Docusaurus website is running at: http://localhost:3000/
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

✔ Client
  Compiled successfully in 2.67s

client (webpack 5.86.0) compiled successfully

复现步骤

  1. 打开终端并导航到项目目录。
  2. 运行 yarn start 命令。
  3. 观察终端输出的警告信息。

预期行为

开发服务器应正常启动,并且不应出现任何弃用警告。

实际行为

尽管开发服务器成功启动,但出现了以下弃用警告:

(node:38404) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

环境信息

  • 操作系统:macOS
  • Node.js 版本:v22.3.0
  • Yarn 版本:v1.22.22
  • Docusaurus 版本:3.5.2
@jxlpzqc
Copy link
Contributor

jxlpzqc commented Oct 9, 2024

可以 pull 到 master 最新 commit 并删除 node_modules 重新再尝试一下,目前 docusaurus 已升级到最新版本,不知道该 warning 是否存在。

@mudongliang
Copy link
Member

@ywh555hhh 请帮忙测试一下当前master分支是否已经没有这个问题了,谢谢

@ywh555hhh
Copy link
Member Author

我注意到在使用最新版本的 Docusaurus(3.5.2)和 Node.js 时,仍然会出现 punycode 模块的弃用警告。经过进一步调查,我发现这个问题已经在其仓库里 Issue #10107 中进行了详细讨论。

根据该 Issue 的讨论,官方计划在即将发布的 4.0 版本中修复这个问题。然而,目前 4.0 版本尚未发布,因此这个警告仍然存在。

@mudongliang
Copy link
Member

让我们保持这个 issue open,直到我们最终解决这个问题

@mudongliang mudongliang added the help wanted Extra attention is needed label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants