kleydon / prisma-session-store

Express session store for Prisma
MIT License
116 stars 18 forks source link

global.Express has no exported member 'SessionData' #30

Closed itstheandre closed 3 years ago

itstheandre commented 3 years ago

Hey there! I got this error with this session store

node_modules/@quixo3/prisma-session-store/dist/lib/prisma-session-store.d.ts:153:64 - error TS2694: Namespace 'global.Express' has no exported member 'SessionData'.

I got this error in my projet and I believe its because of the way you built the types 🤔

Do you know if there is a way to update this somehow?

Thanks

wSedlacek commented 3 years ago

What version of @types/express and @types/express-session do you have installed?

itstheandre commented 3 years ago

Hey @wSedlacek , these are the current ones:

 "@types/express-session": "1.17.3",
"@types/express": "^4.17.8",

The only way i can get to make it work is:

 "@types/express-session": "1.15.16",
"@types/express": "^4.17.8",

If i do the express session with that, it works. But not with the most up to date dependencies

itstheandre commented 3 years ago

I believe this is happening because of the SessionData not being available in the global.Express anymore. I saw your PR and it might be the right solution. Would need to test it out

EDIT: Fixed a typo

wSedlacek commented 3 years ago

@itstheandre Thank you for notifying us of this issue. I have recreated it. It appears that @types/express-session had some breaking changes since we last updated that package. I have created a PR to fix this issue, and as you can see from the test it is passing with 100% test coverage. Once it is merged in your issue should be fixed, but I am looking into how we can assure that compatibly type packages are used in the future either through dependencies or peerDependencies.

In any case, once the next version is released, update and reopen this issue if the problem is not fixed.

kleydon commented 3 years ago

:tada: This issue has been resolved in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: