Would be good to have a debug log for failed module resolution
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu trong packages/host/src/node/path-utils.ts, tại resolvePackageRoot và TODO trong khối catch của nó. Tái hiện lỗi phân giải index.cjs được nêu trong issue, sau đó xác minh rằng việc phân giải thất bại sẽ phát ra debug log trong khi hàm vẫn trả về undefined.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Just got tripped up by this, but figured it out (my npm package was missing an index.cjs file). Would've figured it out sooner if we'd had an error log (which indeed was TODO), so just tracking this.
export function resolvePackageRoot(
// createRequire(path.join("/Users/jamie/Documents/git/expo-macos-nativescript", "noop.js"))
requireFromPackageRoot: NodeJS.Require,
// "@nativescript/macos-node-api"
packageName: string,
): string | undefined {
try {
const resolvedPath = requireFromPackageRoot.resolve(packageName);
return packageDirectorySync({ cwd: resolvedPath });
} catch {
// TODO: Add a debug log here
return undefined;
}
}
Error: Cannot find module '/Users/jamie/Documents/git/expo-macos-nativescript/node_modules/@nativescript/macos-node-api/index.cjs'
at createEsmNotFoundErr (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:1493:15)
at finalizeEsmResolution (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:1482:9)
at resolveExports (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:685:14)
at Module._findPath (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:752:31)
at Module._resolveFilename (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:1441:27)
at require.resolve (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/helpers.js:163:19)
at eval (<node_internals>/eval-b052276f.repl:1:30)
at resolvePackageRoot (/Users/jamie/Documents/git/expo-macos-nativescript/node_modules/react-native-node-api/dist/node/path-utils.js:215:9)
at /Users/jamie/Documents/git/expo-macos-nativescript/node_modules/react-native-node-api/dist/node/path-utils.js:247:40
at Array.flatMap (<anonymous>) {code: 'MODULE_NOT_FOUND', path: '/Users/jamie/Documents/git/expo-macos-nativescript/node_modules/@nativescript/macos-node-api', stack: "Error: Cannot find module '/Users/jamie/Docum….js:247:40
at Array.flatMap (<anonymous>)", message: "Cannot find module '/Users/jamie/Documents/g…ules/@nativescript/macos-node-api/index.cjs'"}
- Ngôn ngữ chính
- TypeScript
- Star
- 188
- Fork
- 10
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 callstackincubator/react-native-node-api
-
Android 🤖
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Sanity check of Hermes source directory via environment variable, when building Android projects Đang mởAndroid 🤖 good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
callstackincubator/react-native-node-api#163 · 1 bình luận ·
-
enhancement good first issue gyp-to-cmake
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
callstackincubator/react-native-node-api#161 · 3 bình luận · 1 reaction ·
-
enhancement Host 🏡
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Automatable good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 15/100
callstackincubator/react-native-node-api#424 · 1 bình luận ·
Tất cả issue của callstackincubator/react-native-node-api
Issue tương tự
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Đang mởclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
supermomonga/zcode-acp#24 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
growthbook/growthbook#7100 ·
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100