Unable to initialize library
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs
- 领域
- devtools
调研方向
复现代码位于 index.js 中,依赖项在 package.json 中固定为 httpsnippet ^2.0.0。首先运行 node index.js 并检查该包导出的值;当显示的 HTTPSnippet 初始化成功并生成所请求的 curl 输出时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
The library is not getting instantiated, Created a basic node project and trying to instantiate the library. Does not work.
index.js
const HTTPSnippet = require('httpsnippet').HTTPSnippet
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);
Package JSON
{
"name": "http-code-generator",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"httpsnippet": "^2.0.0"
}
}
Getting this below error
const snippet = new HTTPSnippet({
^
TypeError: HTTPSnippet is not a constructor
at Object.<anonymous> (/Users/cpandit/WebstormProjects/untitled1/index.js:6:17)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
➜ untitled1
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 245
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Kong/httpsnippet 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
Kong/httpsnippet#356 ·
-
难度 4/5 3-5 天 新手友好度 35/100
Kong/httpsnippet#397 ·
-
难度 3/5 1-2 天 新手友好度 35/100
Kong/httpsnippet#389 ·
-
难度 5/5 一周以上 新手友好度 25/100
Kong/httpsnippet#383 ·
-
Bug: R Code Generation Does Not Quote Parameters with Special Characters (e.g., `codes[]`)可能已有人在做 @abansal21 于 499 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
Kong/httpsnippet#379 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
rel: fix
难度 2/5 1-3 小时 新手友好度 68/100
Deltares/fews-web-oc#2400 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
ardia-browser/ardia#4426 ·
维护者通常 1 天内回复
-
Bug report: isValidISODateDashOnly accepts text before or after the date-time可能已有人在做 @bardrop 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 88/100
pnp/cli-microsoft365#7713 ·
维护者通常 1 天内回复
-
Diagram: Journey Type: Bug / Error
难度 2/5 1-3 小时 新手友好度 62/100
mermaid-js/mermaid-v13#1293 ·
维护者通常 1 天内回复