Describe the bug
@workos/authkit-tanstack-react-start@0.9.1 still causes the Vite dev browser client to crash with the same eventemitter3 default export error described in #82.
The console error is:
Uncaught SyntaxError: The requested module '/@fs/.../node_modules/.bun/eventemitter3@5.0.4/node_modules/eventemitter3/index.js?v=b3194e12' does not provide an export named 'default' (at index.mjs?v=b3194e12:1:8)
This looks related to #82 / #93. I can confirm v0.9.1 contains the lazy import fix in dist/server/authkit-loader.js, but there still appear to be static imports/re-exports from @workos/authkit-session in server modules that can enter the Vite dev client graph.
Examples in the published 0.9.1 package:
// dist/server/server-fn-bodies.js
import { selectStalePKCEVerifierCookieNames } from '@workos/authkit-session';
// dist/server/server.js
import { getPKCECookieNameForState } from '@workos/authkit-session';
// dist/server/index.js
export { OAuthStateMismatchError, PKCECookieMissingError } from '@workos/authkit-session';
Since @workos/authkit-session pulls in @workos-inc/node, which imports eventemitter3, this seems to reintroduce the browser dev graph leak that #93 was intended to fix.
To Reproduce
Steps to reproduce the behavior:
- Install
@workos/authkit-tanstack-react-start@0.9.1
- Use
authkitMiddleware() in src/start.ts
- Use client imports from
@workos/authkit-tanstack-react-start/client
- Start the app with Vite dev
- Open the app in Chrome
- See the browser console error above
Expected behavior
Vite dev should not load @workos-inc/node / eventemitter3 into the browser client graph. The app should load without the eventemitter3 default export syntax error.
Screenshots
N/A
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- authkit-tanstack-start version:
0.9.1
- Tanstack Start version:
1.168.25
- Vite version:
8.0.16
- Package manager: Bun
Additional context
Related upstream items:
Describe the bug
@workos/authkit-tanstack-react-start@0.9.1still causes the Vite dev browser client to crash with the sameeventemitter3default export error described in #82.The console error is:
This looks related to #82 / #93. I can confirm
v0.9.1contains the lazy import fix indist/server/authkit-loader.js, but there still appear to be static imports/re-exports from@workos/authkit-sessionin server modules that can enter the Vite dev client graph.Examples in the published
0.9.1package:Since
@workos/authkit-sessionpulls in@workos-inc/node, which importseventemitter3, this seems to reintroduce the browser dev graph leak that #93 was intended to fix.To Reproduce
Steps to reproduce the behavior:
@workos/authkit-tanstack-react-start@0.9.1authkitMiddleware()insrc/start.ts@workos/authkit-tanstack-react-start/clientExpected behavior
Vite dev should not load
@workos-inc/node/eventemitter3into the browser client graph. The app should load without theeventemitter3default export syntax error.Screenshots
N/A
Desktop (please complete the following information):
0.9.11.168.258.0.16Additional context
Related upstream items:
@workos/authkit-sessioninauthkit-loader.v0.9.1includes fix: lazy-import @workos/authkit-session in authkit-loader #93, but the issue still reproduces.