Closed nles closed 1 year ago
Hi, I'm getting this TypeScript error when importing the server part:
Linter doesn't complain when imported from next-client-cookies/dist/server, but that'll break the runtime.
next-client-cookies/dist/server
Bit weird, since you are using TypeScript here and have things properly typed. Probably some sort of a misconfiguration here or on my end..
Here's my tsconfig.json:
{ "compilerOptions": { "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "incremental": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", "baseUrl": ".", "paths": { "@/*": ["./*"] }, "plugins": [ { "name": "next" } ], "strictNullChecks": true }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "constants.mjs"], "exclude": ["node_modules"] }
I think it's related to old TypeScript version that can't read properly the package exports section.
exports
I've released a fix under 1.0.1, please check if it works for you.
1.0.1
Hi, I'm getting this TypeScript error when importing the server part:
Linter doesn't complain when imported from
next-client-cookies/dist/server
, but that'll break the runtime.Bit weird, since you are using TypeScript here and have things properly typed. Probably some sort of a misconfiguration here or on my end..
Here's my tsconfig.json: