Giter Site home page Giter Site logo

Comments (5)

airhorns avatar airhorns commented on July 24, 2024

Can you post the error that you get and see if you can create a minimal reproduction? It's hard and insecure for us to debug running a large codebase of someone elses, the closer you can get to the problem the more we can get!

from fastify-websocket.

schwamic avatar schwamic commented on July 24, 2024

Can you post the error that you get

{"level":50,"time":1639334951150,"pid":12450,"hostname":"schwamic.local","reqId":"req-i","stack":"TypeError: request.getSession is not a function\n    at Object.global (/Users/schwamic/Documents/risiko/packages/server/routes/subscriptions/subscriptions.controller.js:7:38)\n    at /Users/schwamic/Documents/risiko/node_modules/fastify-websocket/index.js:117:34\n    at /Users/schwamic/Documents/risiko/node_modules/fastify-websocket/index.js:67:7\n    at WebSocketServer.completeUpgrade (/Users/schwamic/Documents/risiko/node_modules/ws/lib/websocket-server.js:408:5)\n    at WebSocketServer.handleUpgrade (/Users/schwamic/Documents/risiko/node_modules/ws/lib/websocket-server.js:316:10)\n    at handleUpgrade (/Users/schwamic/Documents/risiko/node_modules/fastify-websocket/index.js:55:9)\n    at Object.routeOptions.handler (/Users/schwamic/Documents/risiko/node_modules/fastify-websocket/index.js:113:9)\n    at preHandlerCallback (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/handleRequest.js:126:28)\n    at preValidationCallback (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/handleRequest.js:109:5)\n    at handler (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/handleRequest.js:72:7)\n    at handleRequest (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/handleRequest.js:20:5)\n    at next (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/route.js:448:7)\n    at Object.preParsing (/Users/schwamic/Documents/risiko/node_modules/fastify-compress/index.js:299:14)\n    at next (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/route.js:458:18)\n    at preParsingHookRunner (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/route.js:478:3)\n    at runPreParsing (/Users/schwamic/Documents/risiko/node_modules/fastify/lib/route.js:425:5)","type":"Error","msg":"request.getSession is not a function"}

and see if you can create a minimal reproduction?

si claro! https://github.com/schwamic/issues-169

Thank you for your help!

from fastify-websocket.

mcollina avatar mcollina commented on July 24, 2024

It seems you are not defining getSession() anywhere. Check out fastify-secure-session or fastify-session.

from fastify-websocket.

schwamic avatar schwamic commented on July 24, 2024

I think this should definitely be included in the README. How is anyone supposed to know where getSession comes from? I thought it was part of fastify. I can take over and set a PR if that helps you?

from fastify-websocket.

mcollina avatar mcollina commented on July 24, 2024

Go for it, thanks!

from fastify-websocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.