[PR #8769] fix(sso): use namespace import for samlify to fix ESM compatibility #16449

Closed
opened 2026-04-13 10:31:33 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/8769

State: closed
Merged: No


samlify is a CJS module that sets __esModule: true but has no exports.default. Using import saml from "samlify" resolves to undefined in ESM runtimes, causing saml.setSchemaValidator(...) to throw TypeError at module load time.

Switch to import * as saml from "samlify" which correctly provides the full namespace object with all named exports.

Also updates the smoke test to use native ESM import instead of createRequire, so this regression is caught in CI.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/8769 **State:** closed **Merged:** No --- samlify is a CJS module that sets __esModule: true but has no exports.default. Using `import saml from "samlify"` resolves to undefined in ESM runtimes, causing `saml.setSchemaValidator(...)` to throw TypeError at module load time. Switch to `import * as saml from "samlify"` which correctly provides the full namespace object with all named exports. Also updates the smoke test to use native ESM import instead of createRequire, so this regression is caught in CI.
GiteaMirror added the pull-request label 2026-04-13 10:31:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16449