When using @workos/authkit-tanstack-react-start with Vite, I'm encountering an ESM/CommonJS interop error with the cookie package (a transitive dependency). The error occurs during dev when Vite tries to optimize dependencies.
Here's my error message:
'/@fs/home/me/code/work/tarvo/node_modules/.pnpm/cookie@0.7.2/node_modules/cookie/index.js?v=6e719b3f' does not provide an export named 'parse' (at index.js?v=6e719b3f:1:21)
My environment:
Package version (pnpm): @workos/authkit-tanstack-react-start@^0.2.0
Vite version: 7.1.7
Node: 22.211
OS: Linux (WSL2)
I did the exact same steps as the README file. I got this issue in the browser console not the terminal.
- The
cookie package (v0.7.2) is a transitive dependency
- This appears to be a Vite dependency optimization issue where CommonJS modules aren't being properly converted to ESM
- Similar issues have been reported with other packages that have
.jsx entry points instead of .js files
This issue is similar to problems where Vite cannot optimize dependency interop when packages have non-standard entry points or CommonJS/ESM interop issues.
When using
@workos/authkit-tanstack-react-startwith Vite, I'm encountering an ESM/CommonJS interop error with thecookiepackage (a transitive dependency). The error occurs during dev when Vite tries to optimize dependencies.Here's my error message:
My environment:
Package version (pnpm):
@workos/authkit-tanstack-react-start@^0.2.0Vite version:
7.1.7Node:
22.211OS:
Linux (WSL2)I did the exact same steps as the README file. I got this issue in the browser console not the terminal.
cookiepackage (v0.7.2) is a transitive dependency.jsxentry points instead of.jsfilesThis issue is similar to problems where Vite cannot optimize dependency interop when packages have non-standard entry points or CommonJS/ESM interop issues.