ReferenceError: Cannot access 'ManagementError' before initialization
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Start with the generated ManagementTimeoutError.ts and the errors barrel it imports, then check how Fern generates this file and how the ESM build is produced. Reproduce the import failure without creating an Auth0 client or making a network request. Done when the generated error imports ManagementError directly, the cycle is removed, and importing the ESM build succeeds while public exports remain intact.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Checklist
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
ESM import can access ManagementError before initialization
Summary
Importing the ESM build can fail during module initialization with:
ReferenceError: Cannot access 'ManagementError' before initialization
at .../auth0/dist/esm/management/errors/ManagementTimeoutError.mjs:3:52
The failure occurs before an Auth0 client is instantiated or a network request is made, so no Auth0 credentials are required to investigate it.
Suspected cause
ManagementTimeoutError imports the errors barrel and extends its ManagementError export:
import * as errors from "./index.js";
export class ManagementTimeoutError extends errors.ManagementError {}
The barrel also exports ManagementTimeoutError, producing this cycle:
ManagementTimeoutError -> errors/index -> ManagementTimeoutError
Proposed generator change
Generate a direct dependency on the base error instead:
import { ManagementError } from "./ManagementError.js";
export class ManagementTimeoutError extends ManagementError {}
This removes the error module's barrel cycle while preserving the package's public exports.
Notes for maintainers
ManagementTimeoutError.ts is generated by Fern so I didn't create a PR in this repo for it, not sure how that is typically handled.
Reproduction
I ran into this with a simple import in an ESM project -- happy to create a repro repository if needed.
Additional context
No response
node-auth0 version
7.6.0
Node.js version
26.12
- Ngôn ngữ chính
- TypeScript
- Star
- 683
- Fork
- 319
- Merge trung bình
- 1 ngày 30 phút
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của auth0/node-auth0
-
createManagementAuth drops the custom fetch option from clientOptionsCó thể đã có người làm @RaphaelFakhri đã nhận 28 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
auth0/node-auth0#1432 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
auth0/node-auth0#1387 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
auth0/node-auth0#1295 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
V5 Nullability seems... wrong?Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
auth0/node-auth0#1204 · 11 bình luận · 7 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug vNext
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 38/100
auth0/node-auth0#1106 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của auth0/node-auth0
Issue tương tự
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)Đang mởarea: @angular/build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
angular/angular-cli#34764 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status/need-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
google-gemini/gemini-cli#30384 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug ready-for-human
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
LucasSantana-Dev/Lucky#3150 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue priority: low size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày