Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix passage-node constructor fails in Remix app (Vite SSR import error). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to at least 2.11.0 and change your import. 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.

Steps

  1. 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.

When to use

You are seeing this: 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. Use this skill when you run into "passage-node constructor fails in Remix app (Vite SSR import error)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: v2.11.0, least 2.11.0. If you are on something much newer or older, the details may have shifted.

Why this happens

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.

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 2 · 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>

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