iron-session icon indicating copy to clipboard operation
iron-session copied to clipboard

add iron session import to ts definitions

Open avaleriani opened this issue 2 years ago • 4 comments

this makes the module augmentation work on files like additional.d.ts

avaleriani avatar Apr 11 '22 10:04 avaleriani

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/vvoyer/iron-session-example/H3VTEcq1jV1k7bmZKgLYFNkj3dSo
✅ Preview: https://iron-session-example-git-fork-avaleriani-patch-1-vvoyer.vercel.app

vercel[bot] avatar Apr 11 '22 10:04 vercel[bot]

Hey, @avaleriani thanks for this! I never needed it though, can you link an error you're getting?

Nowadays I use this technique instead: https://github.com/vvo/iron-session/blob/main/examples/next.js-typescript/lib/session.ts

vvo avatar Apr 11 '22 18:04 vvo

This is the error I'm getting when not importing on types.d.ts error

with the approach from your link work perfect, this is only for d.ts files, at least in my next project.

avaleriani avatar Apr 12 '22 10:04 avaleriani

I had the same issue. I have seen it in other projects as well. It happens when the .d.ts file ends up completely overriding the typings.

LiamMartens avatar May 12 '22 19:05 LiamMartens

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
iron-session-example ✅ Ready (Inspect) Visit Preview Aug 25, 2022 at 9:37PM (UTC)

vercel[bot] avatar Aug 25 '22 21:08 vercel[bot]