jshttp / cookie

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

import cookie from 'cookie' resolve as undefined, missing default export #198

Closed alexandre-combemorel closed 1 month ago

alexandre-combemorel commented 1 month ago

I had an issue when building my app with vite, as the export default is missing, vite is actually not able to import the package and resolve it as undefined.

Would it be possible to add an export default ?

index.js:

Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.serialize = serialize;
blakeembrey commented 1 month ago

Probably a duplicate of https://github.com/jshttp/cookie/issues/195. Have you tried using the named imports instead? Not everything needs a default export.

alexandre-combemorel commented 1 month ago

Indeed a duplicate. However having a default export would have given some backward compatibility for a relative small change.