passage-node constructor fails in Remix app (Vite SSR import error)

I was moving my Remix app to Passage and the client side worked fine, cookie stored properly, but the server side blew up with TypeError: _vitessrimport2__.default is not a constructor when I called new Passage. Others hit the same error in Astro SSR mode and SvelteKit. The thread closed in September 2024 with a maintainer confirming the fix.

The default import of passage-node broke under Vite SSR in Remix, Astro, and SvelteKit. It was fixed in v2.11.0 of the package, and the maintainers also recommend switching to the named import syntax, import { Passage } from '@passageidentity/passage-node', since thats the only syntax the next major version will support. Upgrade to at least 2.11.0 and change your import. Source: https://github.com/passageidentity/passage-node/issues/139

Source: https://github.com/passageidentity/passage-node/issues/139