Skip to content

Too many separate @auth/core and jose requests #7424

Open
@Nefcanto

Description

@Nefcanto

The Qwik's HMR is broken for our projects, and each save means a long reload time. In search for finding the problem, we noticed that a lot of links related to the @auth/core and jose packages are being loaded into the browser. We thought that Vite would automatically optimize third-party libraries. But that's not the case for these two packages.

Consider these URLs (taken from the Network tab, and filtered by anything that has @fs in it):

https://example.local/@fs//npm/node_modules/tailwindcss/index.css
https://example.local/@fs/npm/node_modules/vite/dist/client/env.mjs
https://example.local/@fs/npm/node_modules/@builder.io/qwik/dist/core.mjs?v=21a2e76b
https://example.local/@fs/npm/node_modules/@builder.io/qwik-city/lib/index.qwik.mjs?t=1742003243358&v=21a2e76b
https://example.local/@fs/npm/node_modules/zod/lib/index.mjs?v=21a2e76b
https://example.local/@fs/npm/node_modules/swiper/modules/free-mode.css?inline
https://example.local/@fs/npm/node_modules/@auth/qwik/index.qwik.js?t=1742003243358&v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/assert.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/errors.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/env.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/pages/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/logger.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/web.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/actions.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/symbols.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/cookie.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/init.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/callback/oauth/csrf-token.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/preact-render-to-string/dist/index.module.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/pages/error.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/pages/signin.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/pages/signout.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/pages/styles.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/pages/verify-request.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/vendored/cookie.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/preact/dist/preact.module.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/callback/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/session.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/signin/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/signout.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/webauthn-options.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/jwt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/callback-url.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/providers.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/merge.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/webauthn-client.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/date.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/session.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/utils/webauthn-utils.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/signin/authorization-url.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/signin/send-token.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@panva/hkdf/dist/web/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/callback/handle-login.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/callback/oauth/callback.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@auth/core/lib/actions/callback/oauth/checks.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/oauth4webapi/build/index.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/@panva/hkdf/dist/web/runtime/hkdf.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwe/compact/decrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwe/general/decrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwe/general/encrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jws/compact/verify.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jws/flattened/verify.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jws/general/verify.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwt/verify.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwt/decrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwe/compact/encrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jws/compact/sign.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jws/flattened/sign.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jws/general/sign.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwt/sign.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwt/encrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwk/thumbprint.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwk/embedded.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwks/local.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwks/remote.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/jwt/unsecured.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/key/export.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/key/import.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/util/decode_protected_header.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/util/decode_jwt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/util/errors.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/key/generate_key_pair.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/key/generate_secret.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/util/base64url.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/buffer_utils.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/decrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/is_disjoint.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/is_object.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/decrypt_key_management.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/cek.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/validate_crit.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/validate_algorithms.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/normalize_key.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/check_key_type.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/private_symbols.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/encrypt_key_management.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/verify.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/jwt_claims_set.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/encrypt.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/sign.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/digest.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/is_key_like.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/is_jwk.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/invalid_key_input.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/asn1.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/key_to_jwk.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/jwk_to_key.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/base64.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/check_iv_length.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/check_cek_length.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/crypto_key.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/aeskw.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/ecdhes.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/pbes2kw.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/rsaes.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/aesgcmkw.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/subtle_dsa.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/check_key_length.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/epoch.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/secs.js?v=21a2e76b
https://example.local/@fs/npm/node_modules/jose/dist/webapi/lib/iv.js?v=21a2e76b

As you can see, these are the number of files loaded:

NPM Package Number of Lines
@auth/core 33
jose 41

This means that from our typical page with 400 requests, almost 19% of the load is related to these links.
Why is this the behavior of these packages here? And how can fix it?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions