Skip to content

Conversation

Copy link

Copilot AI commented Oct 22, 2025

Problem

The project was failing to build with Node.js 17+ due to OpenSSL incompatibility in Next.js 10.0.8, and had 19 security vulnerabilities in dependencies.

Build Error

Error: error:0308010C:digital envelope routines::unsupported

This error occurs because Next.js 10 uses webpack 4, which relies on legacy cryptographic algorithms removed in Node.js 17+.

Solution

1. Fixed Build Compatibility

Added NODE_OPTIONS=--openssl-legacy-provider to enable legacy OpenSSL provider:

  • Updated all npm scripts in package.json (dev, build, export, deploy)
  • Updated GitHub Actions workflow to include the environment variable

This allows the project to build successfully with Node.js 20 without requiring a major Next.js upgrade.

2. Improved Security

Ran npm audit fix to update dependencies without breaking changes:

  • Before: 19 vulnerabilities (6 moderate, 5 high, 8 critical)
  • After: 11 vulnerabilities (5 moderate, 2 high, 4 critical)
  • Result: 42% reduction (8 vulnerabilities fixed)

Fixed vulnerabilities in: braces, browserify-sign, cipher-base, elliptic, nanoid, pbkdf2, semver, and sha.js.

3. Updated Dependencies

  • Updated browserslist database from version 1.0.30001468 to 1.0.30001751
  • Updated 28 packages to more secure versions

Testing

All functionality verified working:

  • ✅ Build process (npm run build)
  • ✅ Development server (npm run dev)
  • ✅ Static export (npm run export)
  • ✅ Full deployment (npm run deploy)
  • ✅ GitHub Actions CI/CD pipeline

Remaining Items

11 security vulnerabilities remain that require Next.js 12+ (a breaking change). These are documented in PROJECT_STATUS.md with recommendations for future upgrades.

Documentation

Added PROJECT_STATUS.md with:

  • Detailed analysis of issues found and fixed
  • Test results and verification
  • Recommendations for long-term improvements
  • Current status of all features

The project now builds and deploys successfully with modern Node.js versions while maintaining backward compatibility with the existing codebase.

Original prompt

检查项目


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 22, 2025 09:28
Co-authored-by: fullalien <24403750+fullalien@users.noreply.github.com>
Co-authored-by: fullalien <24403750+fullalien@users.noreply.github.com>
Copilot AI changed the title [WIP] Check current project status and details Fix Node.js compatibility and resolve security vulnerabilities Oct 22, 2025
Copilot AI requested a review from fullalien October 22, 2025 09:32
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

Successfully merging this pull request may close these issues.

2 participants