TypeError when creating a SourceMapGenerator from a SourceMapConsumer of an index map
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
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu với lib/source-map-generator.js quanh fromSourceMap và lib/util.js quanh relative, sau đó tái hiện lỗi bằng ví dụ test.js trong issue. Thêm một bài kiểm thử hồi quy cho việc chuyển đổi một SourceMapConsumer của index-map, đồng thời xem xét các phép so sánh sourceRoot hiện có. Công việc được xem là hoàn tất khi quá trình chuyển đổi không còn phát sinh lỗi và các bài kiểm thử liên quan đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When calling SourceMapGenerator.fromSourceMap with a SourceMapConsumer for an index map, the following error is thrown:
TypeError: Cannot read property 'replace' of undefined
at Object.relative (C:\dev\scratch\source-map-test\node_modules\source-map\lib\util.js:255:17)
at C:\dev\scratch\source-map-test\node_modules\source-map\lib\source-map-generator.js:75:31
at Array.forEach (<anonymous>)
at Function.fromSourceMap (C:\dev\scratch\source-map-test\node_modules\source-map\lib\source-map-generator.js:72:32)
at test (C:\dev\scratch\source-map-test\test.js:17:52)
at <anonymous>
test.js
const sourcemap = require("source-map");
async function test() {
const map = {
file: "generated.js",
version: 3,
sections: [
{ offset: { column: 0, line: 0 }, map: {
file: "part.js",
version: 3,
sources: ["source.js"],
mappings: "",
names: []
} }
]
};
const consumer = await new sourcemap.SourceMapConsumer(map);
const generator = sourcemap.SourceMapGenerator.fromSourceMap(consumer); // TypeError
}
The error seems to be due to a strict inequality (!==) check on sourceRoot whereas all other checks against sourceRoot use loose inequality (!=).
- Ngôn ngữ chính
- JavaScript
- Star
- 3.7k
- Fork
- 370
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 mozilla/source-map
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mozilla/source-map#530 ·
-
allow wasm to be bundled Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
mozilla/source-map#527 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
mozilla/source-map#524 · 6 bình luận ·
-
source map seems like not work, is there some hints from the perspective of source-map tool? Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
mozilla/source-map#516 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
mozilla/source-map#510 · 1 reaction ·
Tất cả issue của mozilla/source-map
Issue tương tự
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/safe-publish#594 ·
-
内部文件键(绝对路径的 base64)泄漏到界面标签 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NousResearch/hermes-agent#121143 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100