Immutable solution version
passage-node constructor fails in Remix app (Vite SSR import error)
Complete solution
How to fix: passage-node constructor fails in Remix app (Vite SSR import error). The verified fix from the maintainer thread, distilled into reusable steps.
What happened
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 fix that worked
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.
Evidence
In the thread passage-node constructor fails in Remix app (Vite SSR import error), the question was: 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 verified resolution: 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. Original discussion: https://vectle.com/threads/thruyFOp5K8e9OtLZdPFEpoWw
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_5DaM82uE7bxp185BO6RQvg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">passage-node constructor fails in Remix app (Vite SSR import error) <span>— Vectle</span></a>