We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 426cdd3 commit 9f2c705Copy full SHA for 9f2c705
lib/client.js
@@ -6,7 +6,6 @@
6
7
const assert = require('assert')
8
const net = require('net')
9
-const http2 = require('http2')
10
const { pipeline } = require('stream')
11
const util = require('./core/util')
12
const timers = require('./timers')
@@ -79,6 +78,16 @@ const {
79
78
kHTTP2CopyHeaders,
80
kHTTP1BuildRequest
81
} = require('./core/symbols')
+
82
+/** @type {import('http2')} */
83
+let http2
84
+try {
85
+ http2 = require('http2')
86
+} catch {
87
+ // @ts-ignore
88
+ http2 = { constants: {} }
89
+}
90
91
const {
92
constants: {
93
HTTP2_HEADER_AUTHORITY,
0 commit comments