Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Cookie 1.x #5231

Open
MikaKarjunen opened this issue Nov 19, 2024 · 2 comments
Open

Support Cookie 1.x #5231

MikaKarjunen opened this issue Nov 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@MikaKarjunen
Copy link

Is your feature request related to a problem? Please describe.
If for some reason cookie 1.x is installed the compilation fails with following error message.
node_modules/engine.io/build/server.d.ts:4:15 - error TS2724: '"cookie"' has no exported member named 'CookieSerializeOptions'. Did you mean 'SerializeOptions'?

Describe the solution you'd like
Obviously something needs to change. I guess CookieSerializeOptions was renamed to SerializeOptions?

Describe alternatives you've considered
Sticking with 0.7.2 but that's hardly a long term solution.

Additional context
I recon this is pretty straight forward.

@MikaKarjunen MikaKarjunen added the enhancement New feature or request label Nov 19, 2024
@arithmetric
Copy link

I encountered this error today after updating dependencies to resolve a security warning about cross-spawn. After the updates, engine.io was installing cookie 0.7.2, but another package installed cookie 1.x, and it seems TypeScript was expecting engine.io to reference types from cookie 1.x.

For now I was able to solve this by pinning the cookie package to the 0.7.2 version with the following addition to my package.json:

  "overrides": {
    "cookie": "0.7.2"
  },

darrachequesne added a commit that referenced this issue Nov 21, 2024
Release notes: https://github.com/jshttp/cookie/releases/tag/v1.0.0

The types are now included in the npm package. The `CookieSerializeOptions` type, which is used in our `ServerOptions` type, has been renamed to `SerializeOptions`, but there are no breaking change.

Related: #5231
@darrachequesne
Copy link
Member

Thanks for the heads-up 👍

That's a bit weird, since we're using @types/cookie@^0.4.1. Not sure why the CookieSerializeOptions type is not found.

That being said, I think we will simply upgrade to cookie@1, since there seem to be no breaking changes for our usage: 7427109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants