Skip to content

typescript error when generating inferred declarations #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cruzdanilo opened this issue May 17, 2025 · 0 comments
Open

typescript error when generating inferred declarations #698

cruzdanilo opened this issue May 17, 2025 · 0 comments

Comments

@cruzdanilo
Copy link

Describe the issue

typescript error when generating inferred declarations.

Reproduction Steps

index.js:

import {
  generateRegistrationOptions,
  type PublicKeyCredentialCreationOptionsJSON,
} from "@simplewebauthn/server";
import { Hono } from "hono";

export default new Hono().get("/", async (c) => {
  const options: PublicKeyCredentialCreationOptionsJSON =
    await generateRegistrationOptions({
      rpID: "test.com",
      rpName: "test",
      userName: "test",
    });
  return c.json(options, 200);
});

run:

tsc --declaration --skipLibCheck --module esnext --moduleResolution bundler index.ts

error:

index.ts(7,1): error TS2742: The inferred type of 'default' cannot be named without a reference to './node_modules/@simplewebauthn/server/esm/types/dom'. This is likely not portable. A type annotation is necessary.

Expected behavior

no error

Dependencies

SimpleWebAuthn Libraries

├── @simplewebauthn/[email protected] -> ./node_modules/.pnpm/@[email protected]/node_modules/@simplewebauthn/server

Additional context

proposed fix: #697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant