jshttp / cookie

HTTP server cookie parsing and serialization
MIT License
1.35k stars 156 forks source link

Default export missing #197

Closed fabb closed 3 weeks ago

fabb commented 3 weeks 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 3 weeks 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 3 weeks ago

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

blakeembrey commented 3 weeks 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.