Skip to content

Commit acc5756

Browse files
committed
fix: add dynamic npm imports
1 parent b6cbe17 commit acc5756

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@oak/acorn",
3-
"version": "0.7.0-alpha.3",
3+
"version": "0.7.0-alpha.4",
44
"exports": {
55
".": "./mod.ts",
66
"./context": "./context.ts",

http_server_node.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ export default class HttpServer implements Server {
158158

159159
async listen(): Promise<Listener> {
160160
if (!("Request" in globalThis) || !("Response" in globalThis)) {
161+
// adding this dependencies because for some reason they are picked up
162+
// in undici directly when deploying on CFW, even though they aren't
163+
// actually used at runtime
164+
await import("npm:buffer@^6.0");
165+
await import("npm:string_decoder@^1.3");
161166
const { Request, Response } = await import("npm:undici@^6.18");
162167
Object.defineProperties(globalThis, {
163168
"Request": {

0 commit comments

Comments
 (0)