Kong / Kong/httpsnippet

does not work with vite

Offen
#329 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
1.2k
Forks
242
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript, vite
Bereich
build-system, frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.