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

【Bug】无法在 Nodejs LTS 18 完成编译构建 #635

Closed
Dragon1573 opened this issue Oct 29, 2022 · 3 comments
Closed

【Bug】无法在 Nodejs LTS 18 完成编译构建 #635

Dragon1573 opened this issue Oct 29, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Dragon1573
Copy link

问题描述

无法在 Nodejs LTS v18 环境下完成项目构建,yarn run dev 无法启动测试服务器,GitHub Workflows 执行 yarn build 失败。

重现步骤

此处使用 Docker 进行复现。

# 在宿主环境执行
docker run -d -p 8080:8080 -name report_issue node:18
docker exec -it report_issue /bin/bash

# 在容器中执行
mkdir -v /workspace && cd /workspace
git clone https://github.com/Dragon1573/Study-Notes.git && cd Study-Notes
git checkout 396ec9da2d06dde16b3ab81e1514d783390f962f
yarn install && yarn run dev

重现链接

GitHub Actions 构建失败记录
GitHub Actions 日志文件包

问题截图

Docker yarn run dev 报错内容

image

GitHub Actions 构建失败记录

image

依赖版本

  • node: v18.12.0
  • npm: 8.19.2
  • yarn: 3.2.4
  • vuepress: @npm:1.9.7
  • vuepress-theme-vdoing: @npm:1.12.8
Docker 复现环境截图

image

补充说明

在 Nodejs v16.x 中未见此现象,详情请查看 GitHub Actions 构建记录

关于此错误,vuepress-theme-vdoing 能否提供一些可选的解决方案呢?或者,是否需要将此 Issue 转移给其他团队?

@Dragon1573 Dragon1573 added the bug Something isn't working label Oct 29, 2022
Dragon1573 added a commit to Dragon1573/Boudoir-of-Sagiri that referenced this issue Oct 29, 2022
- This reverts commit 396ec9d
- It looks like that `vuepress-theme-vdoing` does not support Nodejs LTS
  v18. An issue is opened for this situation on
  xugaoyi/vuepress-theme-vdoing#635
Dragon1573 referenced this issue in Dragon1573/Boudoir-of-Sagiri Oct 29, 2022
Nodejs LTS v16.x --> Nodejs LTS v18.x

Signed-off-by: Dragon1573 <49941141+Dragon1573@users.noreply.github.com>
Dragon1573 added a commit to Dragon1573/Boudoir-of-Sagiri that referenced this issue Oct 30, 2022
- xugaoyi/vuepress-theme-vdoing#635
- Nodejs v17 及后续版本更新了 OpenSSL ,可能与 Webpack 不兼容
- 添加环境变量,让 Nodejs 使用过去的版本,可以通过 `yarn run dev` 和 `yarn run test`

Signed-off-by: Dragon1573 <49941141+Dragon1573@users.noreply.github.com>
@Dragon1573
Copy link
Author

临时解决方案

  1. 回退到 Nodejs LTS v16 及以下版本
  2. 配置环境变量 NODE_OPTIONS="--openssl-legacy-provider" ,让 Nodejs 使用旧版本兼容的 OpenSSL

@xugaoyi
Copy link
Owner

xugaoyi commented Nov 3, 2022

看报错日志是loader-runner这个包报错,你可以去这个包相关仓库看看。
解决方案暂时还是先降低nodejs的版本吧

@Dragon1573
Copy link
Author

估计是 Nodejs 自身及其相关的一些核心内容导致的,像 webpack/webpack#14532nodejs/node#40455 都有提及。

上面的临时解决方案第2条好像只在 Nodejs v18.x 有效果。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants