Error: strict mode: unknown keyword: "afterRequest"
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
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Tái hiện lỗi bằng ví dụ cơ bản được ghi trong tài liệu và lệnh httpsnippet example.json --target shell --client curl --output ./examples, sử dụng các phiên bản được nêu trong issue. Kiểm tra cấu hình dependency trong package.json và entry point của CLI, sau đó lần theo đường dẫn validation được hiển thị trong stack trace. Hoàn thành khi cả hai đường dẫn invocation được ghi trong tài liệu không còn thất bại do keyword không xác định afterRequest.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am getting the below error when executing the basic example provided in the docs in my NodeJs project:
/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/index.js:120
throw e;
^
Error: strict mode: unknown keyword: "afterRequest"
at checkStrictMode (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/util.js:174:15)
at checkUnknownRules (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/util.js:32:13)
at checkKeywords (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/validate/index.js:120:34)
at validateFunctionCode (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/validate/index.js:19:9)
at Ajv.compileSchema (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/index.js:80:45)
at Ajv.resolveSchema (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/compile/index.js:193:23)
at Ajv.getSchema (/Users/harsh/Desktop/http-snippet-demo/node_modules/ajv/dist/core.js:279:43)
at validateHarRequest (/Users/harsh/Desktop/http-snippet-demo/node_modules/httpsnippet/dist/helpers/har-validator.js:66:24)
at /Users/harsh/Desktop/http-snippet-demo/node_modules/httpsnippet/dist/httpsnippet.js:262:56
at Array.forEach (<anonymous>)
Example Code:
const express = require('express');
const { HTTPSnippet } = require('httpsnippet');
const app = express();
const snippet = new HTTPSnippet({
method: 'GET',
url: 'http://mockbin.com/request',
});
const options = { indent: '\t' };
const output = snippet.convert('shell', 'curl', options);
console.log(output);
const server = app.listen(8000, '0.0.0.0', () => {
console.log('Example app listening at http://%s:%s', server.address().address, server.address().port);
});
httpsnippet version in package.json file: ^3.0.1
NodeJs version: 18.17
I am getting the same error via CLI as well when executing the below command:
httpsnippet example.json --target shell --client curl --output ./examples
- Ngôn ngữ chính
- TypeScript
- Star
- 1.2k
- Fork
- 245
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không 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 Kong/httpsnippet
-
BUG: Http default clientId errorĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
Kong/httpsnippet#356 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Kong/httpsnippet#397 ·
-
v3.0.9 Bug: Can't resolve 'fs'Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Kong/httpsnippet#389 ·
-
Support for Oracle APEXĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Kong/httpsnippet#383 ·
-
Bug: R Code Generation Does Not Quote Parameters with Special Characters (e.g., `codes[]`)Có thể đã có người làm @abansal21 đã nhận 499 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Kong/httpsnippet#379 ·
Tất cả issue của Kong/httpsnippet
Issue tương tự
-
Độ khó 2/5 1-3 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
-
rel: fix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Deltares/fews-web-oc#2400 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ardia-browser/ardia#4426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timeCó thể đã có người làm @bardrop đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
pnp/cli-microsoft365#7713 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Diagram: Journey Type: Bug / Error
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
mermaid-js/mermaid-v13#1293 ·
Maintainer thường phản hồi trong vòng 1 ngày