Http2 Dependency not found

Just upgraded the JavaScript driver from 4.0.3 to 4.1.0.

Now when I try to launch my dev server I get an error:
This dependency was not found:

  • http2 in ./node_modules/faunadb/src/_http/http2Adapter.JavaScript

Installing http2 leads to another missing dependency: net. And installing that leads to some warnings.

I’ve tried reinstalling faunadb and updating nodejs (isn’t http2 part of node now?). Anyway, any help greatly received as this as brought development to a standstill for me.

Thanks, @ohawkridge, for reporting this. We are looking into it. Meanwhile, can you please continue to use JS 4.0.3 version?

hi. can you share NodeJS version, please? Seems like the old version is used
You can try --expose-http2 flag enables experimental HTTP2 support. This flag can be used in nightly build (Node v8.4.0) since Aug 5, 2017 Starting from NodeJS v8.8.1 you don’t need it flag.

Thanks for the fast reply @Jay-Fauna. I’ll roll back if nothing else works.

@Sergii_Zinkevych I was on Node 14.14 on macOS 11.2.1. I upgraded to 15.9.0 while troubleshooting.

If I find out anything else I’ll post it. Cheers again.

Both versions works for me.
What does node -p process.version and node -p http2 display? The http2 module is built into Node core, so if you’re actually using version 15.9.0 , then it should be there.

also, can you add console.info(process.version) before importing faunadb and share result?

Reinstalled Node again. Version v15.9.0 is defo there. So it seems is http2:

{
  connect: [Function: connect],
  constants: {
    NGHTTP2_ERR_FRAME_SIZE_ERROR: -522,
    NGHTTP2_SESSION_SERVER: 0,
    NGHTTP2_SESSION_CLIENT: 1,
    NGHTTP2_STREAM_STATE_IDLE: 1,
    NGHTTP2_STREAM_STATE_OPEN: 2,
    NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3,
    NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4,
    NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5,
    NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6,
    NGHTTP2_STREAM_STATE_CLOSED: 7,
    NGHTTP2_FLAG_NONE: 0,
    NGHTTP2_FLAG_END_STREAM: 1,
    NGHTTP2_FLAG_END_HEADERS: 4,
    NGHTTP2_FLAG_ACK: 1,
    NGHTTP2_FLAG_PADDED: 8,
    NGHTTP2_FLAG_PRIORITY: 32,
    DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096,
    DEFAULT_SETTINGS_ENABLE_PUSH: 1,
    DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295,
    DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535,
    DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384,
    DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535,
    DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0,
    MAX_MAX_FRAME_SIZE: 16777215,
    MIN_MAX_FRAME_SIZE: 16384,
    MAX_INITIAL_WINDOW_SIZE: 2147483647,
    NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1,
    NGHTTP2_SETTINGS_ENABLE_PUSH: 2,
    NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3,
    NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4,
    NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5,
    NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6,
    NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8,
    PADDING_STRATEGY_NONE: 0,
    PADDING_STRATEGY_ALIGNED: 1,
    PADDING_STRATEGY_MAX: 2,
    PADDING_STRATEGY_CALLBACK: 1,
    NGHTTP2_NO_ERROR: 0,
    NGHTTP2_PROTOCOL_ERROR: 1,
    NGHTTP2_INTERNAL_ERROR: 2,
    NGHTTP2_FLOW_CONTROL_ERROR: 3,
    NGHTTP2_SETTINGS_TIMEOUT: 4,
    NGHTTP2_STREAM_CLOSED: 5,
    NGHTTP2_FRAME_SIZE_ERROR: 6,
    NGHTTP2_REFUSED_STREAM: 7,
    NGHTTP2_CANCEL: 8,
    NGHTTP2_COMPRESSION_ERROR: 9,
    NGHTTP2_CONNECT_ERROR: 10,
    NGHTTP2_ENHANCE_YOUR_CALM: 11,
    NGHTTP2_INADEQUATE_SECURITY: 12,
    NGHTTP2_HTTP_1_1_REQUIRED: 13,
    NGHTTP2_DEFAULT_WEIGHT: 16,
    HTTP2_HEADER_STATUS: ':status',
    HTTP2_HEADER_METHOD: ':method',
    HTTP2_HEADER_AUTHORITY: ':authority',
    HTTP2_HEADER_SCHEME: ':scheme',
    HTTP2_HEADER_PATH: ':path',
    HTTP2_HEADER_PROTOCOL: ':protocol',
    HTTP2_HEADER_ACCEPT_ENCODING: 'accept-encoding',
    HTTP2_HEADER_ACCEPT_LANGUAGE: 'accept-language',
    HTTP2_HEADER_ACCEPT_RANGES: 'accept-ranges',
    HTTP2_HEADER_ACCEPT: 'accept',
    HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: 'access-control-allow-credentials',
    HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: 'access-control-allow-headers',
    HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: 'access-control-allow-methods',
    HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: 'access-control-allow-origin',
    HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: 'access-control-expose-headers',
    HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: 'access-control-request-headers',
    HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: 'access-control-request-method',
    HTTP2_HEADER_AGE: 'age',
    HTTP2_HEADER_AUTHORIZATION: 'authorization',
    HTTP2_HEADER_CACHE_CONTROL: 'cache-control',
    HTTP2_HEADER_CONNECTION: 'connection',
    HTTP2_HEADER_CONTENT_DISPOSITION: 'content-disposition',
    HTTP2_HEADER_CONTENT_ENCODING: 'content-encoding',
    HTTP2_HEADER_CONTENT_LENGTH: 'content-length',
    HTTP2_HEADER_CONTENT_TYPE: 'content-type',
    HTTP2_HEADER_COOKIE: 'cookie',
    HTTP2_HEADER_DATE: 'date',
    HTTP2_HEADER_ETAG: 'etag',
    HTTP2_HEADER_FORWARDED: 'forwarded',
    HTTP2_HEADER_HOST: 'host',
    HTTP2_HEADER_IF_MODIFIED_SINCE: 'if-modified-since',
    HTTP2_HEADER_IF_NONE_MATCH: 'if-none-match',
    HTTP2_HEADER_IF_RANGE: 'if-range',
    HTTP2_HEADER_LAST_MODIFIED: 'last-modified',
    HTTP2_HEADER_LINK: 'link',
    HTTP2_HEADER_LOCATION: 'location',
    HTTP2_HEADER_RANGE: 'range',
    HTTP2_HEADER_REFERER: 'referer',
    HTTP2_HEADER_SERVER: 'server',
    HTTP2_HEADER_SET_COOKIE: 'set-cookie',
    HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: 'strict-transport-security',
    HTTP2_HEADER_TRANSFER_ENCODING: 'transfer-encoding',
    HTTP2_HEADER_TE: 'te',
    HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: 'upgrade-insecure-requests',
    HTTP2_HEADER_UPGRADE: 'upgrade',
    HTTP2_HEADER_USER_AGENT: 'user-agent',
    HTTP2_HEADER_VARY: 'vary',
    HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: 'x-content-type-options',
    HTTP2_HEADER_X_FRAME_OPTIONS: 'x-frame-options',
    HTTP2_HEADER_KEEP_ALIVE: 'keep-alive',
    HTTP2_HEADER_PROXY_CONNECTION: 'proxy-connection',
    HTTP2_HEADER_X_XSS_PROTECTION: 'x-xss-protection',
    HTTP2_HEADER_ALT_SVC: 'alt-svc',
    HTTP2_HEADER_CONTENT_SECURITY_POLICY: 'content-security-policy',
    HTTP2_HEADER_EARLY_DATA: 'early-data',
    HTTP2_HEADER_EXPECT_CT: 'expect-ct',
    HTTP2_HEADER_ORIGIN: 'origin',
    HTTP2_HEADER_PURPOSE: 'purpose',
    HTTP2_HEADER_TIMING_ALLOW_ORIGIN: 'timing-allow-origin',
    HTTP2_HEADER_X_FORWARDED_FOR: 'x-forwarded-for',
    HTTP2_HEADER_ACCEPT_CHARSET: 'accept-charset',
    HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: 'access-control-max-age',
    HTTP2_HEADER_ALLOW: 'allow',
    HTTP2_HEADER_CONTENT_LANGUAGE: 'content-language',
    HTTP2_HEADER_CONTENT_LOCATION: 'content-location',
    HTTP2_HEADER_CONTENT_MD5: 'content-md5',
    HTTP2_HEADER_CONTENT_RANGE: 'content-range',
    HTTP2_HEADER_DNT: 'dnt',
    HTTP2_HEADER_EXPECT: 'expect',
    HTTP2_HEADER_EXPIRES: 'expires',
    HTTP2_HEADER_FROM: 'from',
    HTTP2_HEADER_IF_MATCH: 'if-match',
    HTTP2_HEADER_IF_UNMODIFIED_SINCE: 'if-unmodified-since',
    HTTP2_HEADER_MAX_FORWARDS: 'max-forwards',
    HTTP2_HEADER_PREFER: 'prefer',
    HTTP2_HEADER_PROXY_AUTHENTICATE: 'proxy-authenticate',
    HTTP2_HEADER_PROXY_AUTHORIZATION: 'proxy-authorization',
    HTTP2_HEADER_REFRESH: 'refresh',
    HTTP2_HEADER_RETRY_AFTER: 'retry-after',
    HTTP2_HEADER_TRAILER: 'trailer',
    HTTP2_HEADER_TK: 'tk',
    HTTP2_HEADER_VIA: 'via',
    HTTP2_HEADER_WARNING: 'warning',
    HTTP2_HEADER_WWW_AUTHENTICATE: 'www-authenticate',
    HTTP2_HEADER_HTTP2_SETTINGS: 'http2-settings',
    HTTP2_METHOD_ACL: 'ACL',
    HTTP2_METHOD_BASELINE_CONTROL: 'BASELINE-CONTROL',
    HTTP2_METHOD_BIND: 'BIND',
    HTTP2_METHOD_CHECKIN: 'CHECKIN',
    HTTP2_METHOD_CHECKOUT: 'CHECKOUT',
    HTTP2_METHOD_CONNECT: 'CONNECT',
    HTTP2_METHOD_COPY: 'COPY',
    HTTP2_METHOD_DELETE: 'DELETE',
    HTTP2_METHOD_GET: 'GET',
    HTTP2_METHOD_HEAD: 'HEAD',
    HTTP2_METHOD_LABEL: 'LABEL',
    HTTP2_METHOD_LINK: 'LINK',
    HTTP2_METHOD_LOCK: 'LOCK',
    HTTP2_METHOD_MERGE: 'MERGE',
    HTTP2_METHOD_MKACTIVITY: 'MKACTIVITY',
    HTTP2_METHOD_MKCALENDAR: 'MKCALENDAR',
    HTTP2_METHOD_MKCOL: 'MKCOL',
    HTTP2_METHOD_MKREDIRECTREF: 'MKREDIRECTREF',
    HTTP2_METHOD_MKWORKSPACE: 'MKWORKSPACE',
    HTTP2_METHOD_MOVE: 'MOVE',
    HTTP2_METHOD_OPTIONS: 'OPTIONS',
    HTTP2_METHOD_ORDERPATCH: 'ORDERPATCH',
    HTTP2_METHOD_PATCH: 'PATCH',
    HTTP2_METHOD_POST: 'POST',
    HTTP2_METHOD_PRI: 'PRI',
    HTTP2_METHOD_PROPFIND: 'PROPFIND',
    HTTP2_METHOD_PROPPATCH: 'PROPPATCH',
    HTTP2_METHOD_PUT: 'PUT',
    HTTP2_METHOD_REBIND: 'REBIND',
    HTTP2_METHOD_REPORT: 'REPORT',
    HTTP2_METHOD_SEARCH: 'SEARCH',
    HTTP2_METHOD_TRACE: 'TRACE',
    HTTP2_METHOD_UNBIND: 'UNBIND',
    HTTP2_METHOD_UNCHECKOUT: 'UNCHECKOUT',
    HTTP2_METHOD_UNLINK: 'UNLINK',
    HTTP2_METHOD_UNLOCK: 'UNLOCK',
    HTTP2_METHOD_UPDATE: 'UPDATE',
    HTTP2_METHOD_UPDATEREDIRECTREF: 'UPDATEREDIRECTREF',
    HTTP2_METHOD_VERSION_CONTROL: 'VERSION-CONTROL',
    HTTP_STATUS_CONTINUE: 100,
    HTTP_STATUS_SWITCHING_PROTOCOLS: 101,
    HTTP_STATUS_PROCESSING: 102,
    HTTP_STATUS_EARLY_HINTS: 103,
    HTTP_STATUS_OK: 200,
    HTTP_STATUS_CREATED: 201,
    HTTP_STATUS_ACCEPTED: 202,
    HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203,
    HTTP_STATUS_NO_CONTENT: 204,
    HTTP_STATUS_RESET_CONTENT: 205,
    HTTP_STATUS_PARTIAL_CONTENT: 206,
    HTTP_STATUS_MULTI_STATUS: 207,
    HTTP_STATUS_ALREADY_REPORTED: 208,
    HTTP_STATUS_IM_USED: 226,
    HTTP_STATUS_MULTIPLE_CHOICES: 300,
    HTTP_STATUS_MOVED_PERMANENTLY: 301,
    HTTP_STATUS_FOUND: 302,
    HTTP_STATUS_SEE_OTHER: 303,
    HTTP_STATUS_NOT_MODIFIED: 304,
    HTTP_STATUS_USE_PROXY: 305,
    HTTP_STATUS_TEMPORARY_REDIRECT: 307,
    HTTP_STATUS_PERMANENT_REDIRECT: 308,
    HTTP_STATUS_BAD_REQUEST: 400,
    HTTP_STATUS_UNAUTHORIZED: 401,
    HTTP_STATUS_PAYMENT_REQUIRED: 402,
    HTTP_STATUS_FORBIDDEN: 403,
    HTTP_STATUS_NOT_FOUND: 404,
    HTTP_STATUS_METHOD_NOT_ALLOWED: 405,
    HTTP_STATUS_NOT_ACCEPTABLE: 406,
    HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407,
    HTTP_STATUS_REQUEST_TIMEOUT: 408,
    HTTP_STATUS_CONFLICT: 409,
    HTTP_STATUS_GONE: 410,
    HTTP_STATUS_LENGTH_REQUIRED: 411,
    HTTP_STATUS_PRECONDITION_FAILED: 412,
    HTTP_STATUS_PAYLOAD_TOO_LARGE: 413,
    HTTP_STATUS_URI_TOO_LONG: 414,
    HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415,
    HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416,
    HTTP_STATUS_EXPECTATION_FAILED: 417,
    HTTP_STATUS_TEAPOT: 418,
    HTTP_STATUS_MISDIRECTED_REQUEST: 421,
    HTTP_STATUS_UNPROCESSABLE_ENTITY: 422,
    HTTP_STATUS_LOCKED: 423,
    HTTP_STATUS_FAILED_DEPENDENCY: 424,
    HTTP_STATUS_TOO_EARLY: 425,
    HTTP_STATUS_UPGRADE_REQUIRED: 426,
    HTTP_STATUS_PRECONDITION_REQUIRED: 428,
    HTTP_STATUS_TOO_MANY_REQUESTS: 429,
    HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431,
    HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451,
    HTTP_STATUS_INTERNAL_SERVER_ERROR: 500,
    HTTP_STATUS_NOT_IMPLEMENTED: 501,
    HTTP_STATUS_BAD_GATEWAY: 502,
    HTTP_STATUS_SERVICE_UNAVAILABLE: 503,
    HTTP_STATUS_GATEWAY_TIMEOUT: 504,
    HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505,
    HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506,
    HTTP_STATUS_INSUFFICIENT_STORAGE: 507,
    HTTP_STATUS_LOOP_DETECTED: 508,
    HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509,
    HTTP_STATUS_NOT_EXTENDED: 510,
    HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511
  },
  createServer: [Function: createServer],
  createSecureServer: [Function: createSecureServer],
  getDefaultSettings: [Function: getDefaultSettings],
  getPackedSettings: [Function: getPackedSettings],
  getUnpackedSettings: [Function: getUnpackedSettings],
  sensitiveHeaders: Symbol(nodejs.http2.sensitiveHeaders),
  Http2ServerRequest: [class Http2ServerRequest extends Readable],
  Http2ServerResponse: [class Http2ServerResponse extends Stream]
}

Not sure where I can use console.info(process.version). I’m using faunadb in a Nuxtjs SPA and it won’t even build as is.

can you try add this code to your package.json
“browser”: {
“http2”: false
},

Yeah, same result @Sergii_Zinkevych. Thanks for the suggestion.

Obviously, fauna 4.1.0 is working for other people. It must be something specific about the configuration of my machine.

I’ve just created an empty Node project and it can use http2. @Sergii_Zinkevych it confirms Node 15.9.0 is being used.

So something about how it’s looking for core modules is screwed up in my other project configuration? I’m not a Node expert—any ideas?

@ohawkridge is’t possible to share repo or minimal usage of faunadb that reproduce the issue?

faunadb works fine in a fresh Node project.

Troubleshooting this kind of configuration issue will be a nightmare and it’s obviously specific to my setup and not a problem with fauna. If I knew more about Node I’d be able to say more.

[Edit] A new empty project works, but once I install my project dependencies it breaks. Must be something about a package I’m using?

[Edit 2] I can even require http2 in the same way faunadb does in an otherwise empty .js file and it’s fine. I’m using Nuxtjs. Something is going wrong with how it’s building these files and not finding http2.

Cheers

Just want to close this out so no one at Fauna wastes any time. It is not a problem with faunadb. Turns out the issue was Nuxtjs—my lack of understanding of.

You can’t use modules like http2, fs etc. in client-side code in Nuxt (only server-side code like nuxtServerInit). Understanding the Nuxt lifecycle helps!

1 Like