socketio / socketio/socket.io-website

Express Sesssion Middleware with Typescript Build Error

Open
#396 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
342
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Following this tutorial leads to a compilation error.

A user named Goldjee wrote a fix and posted it in a comment.

All you need to do is change:

declare module "http" {
    interface IncomingMessage {
        session: Session & {
            authenticated: boolean
        }
    }
}

to

declare module 'http' {
    interface IncomingMessage {
        cookieHolder?: string;
        session: Session & Partial<session.SessionData>;
    }
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked tutorial and the referenced comment, then locate the TypeScript declaration shown in the tutorial. Update the session declaration to match the provided replacement and verify that the tutorial no longer produces the reported compilation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.