workos-node icon indicating copy to clipboard operation
workos-node copied to clipboard

Testing new iron-session package version

Open fforres opened this issue 1 year ago • 3 comments

Description

Related to https://github.com/workos/workos-node/issues/1130

Passes all tests, however finding errors on building the final package (using current projects typescript version). As iron-session built package specifies one of their types to be a generic.

node_modules/.pnpm/[email protected]/node_modules/iron-session/dist/index.d.cts:112:77 - error TS2315: Type 'ServerResponse' is not generic.

112     <T extends object>(req: http.IncomingMessage | Request, res: Response | http.ServerResponse<http.IncomingMessage>, sessionOptions: SessionOptions): Promise<IronSession<T>>;
                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I did manually remove the offending type from the created file, built/packaged/released on my account: https://www.npmjs.com/package/@fforres/workos-inc-node and from my tests on a monorepo, seems to be working.

If this helps moving

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

fforres avatar Nov 06 '24 00:11 fforres

@stanleyphu this would really unblock the cloudflare worker community

matheins avatar Nov 22 '24 14:11 matheins

Been testing it for a couple of weeks now in a real application and no issues. Real fix should be different, but would help the many-many folks using workers 🙏🏼

Also pinging @mattgd @gcarvelli JIC?

fforres avatar Nov 22 '24 15:11 fforres

Thanks for the PR @fforres! Problem at the moment is that we need to support Node v16, which iron-session v8 does not if memory serves. We try to circumvent this by providing a worker specific entry point, but clearly something isn't working as expected.

PaulAsjes avatar Nov 22 '24 15:11 PaulAsjes

Gentle ping

smorimoto avatar Dec 02 '25 04:12 smorimoto

Hey there! We're actively working on this in a new, version-8 branch. This has to be part of a major update as these dependencies drop support for EOL Node.js versions (which we're excited to drop support for, too). We're in the final phases of testing this release and hope to get it out soon. Thanks!

nicknisi avatar Dec 02 '25 14:12 nicknisi