Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning using fastify 3.9.x #137

Open
TMantas opened this issue Dec 16, 2020 · 4 comments
Open

Warning using fastify 3.9.x #137

TMantas opened this issue Dec 16, 2020 · 4 comments

Comments

@TMantas
Copy link

TMantas commented Dec 16, 2020

FastifyDeprecation: You are decorating Request/Reply with a reference type. This reference is shared amongst all requests. Use onRequest hook instead. Property: sessionStore

fastify 3.9.1
fastify-session 5.2.1

@aspiiire
Copy link

aspiiire commented Feb 9, 2021

I have the same problem, I'm not really sure if is related to the package since even after commenting out the session package for me the error still shows up!

@BCsabaEngine
Copy link

BCsabaEngine commented Jul 25, 2021

Is this an abbandoned repo? Should remove from https://www.fastify.io/ecosystem/ ...

@BCsabaEngine
Copy link

I have changed to similar repo: @mgcrea/fastify-session

npm i @mgcrea/fastify-session

const fastifysession = require('@mgcrea/fastify-session')
const MemoryStore = require('@mgcrea/fastify-session/lib/store/MemoryStore').MEMORY_STORE

  fastify.register(require('fastify-cookie'))
  fastify.register(fastifysession, {
    secret: SESSION_SECRET,
    cookie: { maxAge: SESSION_TTL },
    store: MemoryStore,
  })

req.session.get + req.session.set

  fastify.get('/', async (req, reply) => {
    let counter = req.session.get('counter')
    if (isNaN(counter))
      counter = 0
    counter++
    req.session.set('counter', counter)
    console.log(counter)

    return reply.view('main', { text: 'text' })
  })

@zekth
Copy link
Contributor

zekth commented Aug 4, 2021

@BCsabaEngine we made an official fork of this repo to continue the work started here. See https://github.com/fastify/session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants