Skip to content

Constructor call fails in a Remix app #139

@mikecousins

Description

@mikecousins

Attempting to move my Remix app over to Passage. The react package seems to be working okay for the client side and I'm getting the cookie stored properly. I'm having issues on the server side though.

I get this error:

TypeError: __vite_ssr_import_2__.default is not a constructor

Executing this code:

// /app/models/session.server.ts
import Passage from '@passageidentity/passage-node';

// other code

  const passage = new Passage({
    appID: process.env.PASSAGE_APP_ID ?? '',
    apiKey: process.env.PASSAGE_API_KEY,
    authStrategy: "HEADER",
  });
  const userId = await passage.authenticateRequest(request);

Feels like potentially an ESM issue? I do notice that your package has pretty messed up types that might be causing it. This is the linter that I usually use to debug my packages: https://publint.dev/@passageidentity/[email protected]

Metadata

Metadata

Assignees

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