jshttp / cookie

HTTP server cookie parsing and serialization
MIT License
1.36k stars 159 forks source link

Default export missing #197

Closed fabb closed 1 month ago

fabb commented 1 month ago

Since the update to 1.0.0, the default export is missing, but the types suggest it is available.

import cookie from 'cookie'
...
cookie.parse(someValue)

This will not throw a typescript error, but it will crash at runtime. Worked fine before 1.0.0.

blakeembrey commented 1 month ago

Duplicate of https://github.com/jshttp/cookie/issues/195. Sounds like you may have a typescript issue, the types don’t indicate a default export. Are you using the types included with the package?

fabb commented 1 month ago

🤷 i‘m on the newest stable typescript version, and i‘ve removed @types/cookie

blakeembrey commented 1 month ago

It might be this option hiding the error: https://www.typescriptlang.org/tsconfig/#allowSyntheticDefaultImports

I’m not sure beyond this, maybe related to esModuleInterop. I can’t tell without more to debug with.