Skip to content

[fix] Version 2.x introduced the URL object, which is not compatible with Node versions below 10. #1808

Closed
@kkdev163

Description

@kkdev163

Describe the bug

Node.js version: 8.11.2

OS version:

Description:

Actual behavior

2024-04-11 14:25:48,740[v2][music-puzzle-admin][music-puzzle-admin][195926][traceId][spanId][uid][0:0][ERROR][mug] - [-/10.200.xxx.xxx/-/58ms GET /puzzle/tag/module/48] nodejs.ReferenceError: URL is not defined

    at Object.redirect (/home/appops/music-puzzle-admin/music-puzzle-admin_online/default/approot/node_modules/koa/lib/response.js:266:7)

url = new URL(url).toString();

Expected behavior

Code to reproduce

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions