Skip to content

Vite ESM interop error with cookie package: "does not provide an export named 'parse'" #25

Description

@abdiths

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions