Kong / Kong/httpsnippet

does not work with vite

未關閉
#329 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
1.2k
分支
242
PR 合併指標
30 天內沒有已合併 PR

描述

It throws error as `global is not defined`
```txt
Error: global is not defined
at node_modules/.pnpm/event-stream@3.3.4/node_modules/event-stream/index.js (http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/httpsnippet_src_index.js?v=8be32947:2722:23)
at __require (http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/chunk-5WWUZCGV.js?v=8be32947:8:50)
at node_modules/.pnpm/httpsnippet@2.0.0_mkdirp@1.0.4/node_modules/httpsnippet/src/index.js (http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/httpsnippet_src_index.js?v=8be32947:10392:14)
at __require (http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/chunk-5WWUZCGV.js?v=8be32947:8:50)
at http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/httpsnippet_src_index.js?v=8be32947:10614:16
```

which is because of the library `event-stream` is not a browser compatible lib?

Using version: 3.0.1
vite: 4.4.9

貢獻指南

開啟貢獻指南

研究方向

Start by tracing the event-stream dependency shown in the stack trace and its import from httpsnippet/src/index.js under a Vite browser build. Confirm the failure with the reported Vite 4.4.9 setup; done means the package builds and runs in the browser without the global-is-not-defined error.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript, vite
領域
build-system, frontend
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。