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

Attempting to fix SSR. #2243 #2247

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Attempting to fix SSR. #2243 #2247

merged 2 commits into from
Nov 29, 2023

Conversation

dessalines
Copy link
Member

@dessalines dessalines commented Nov 28, 2023

Description

Trying two different things to fix the SSR issue. But since I can't actually replicate the bug locally, these are just guesses.

  • Removing cross-fetch. This seems to be abandoned, and everything appears to be working without it. I've also had some issues with it elsewhere.
  • Fixing a minor issue with setting the headers.

);

const auth = req.headers.cookie
? cookie.parse(req.headers.cookie).jwt
: undefined;

if (auth) {
client.setHeaders({ Authorization: `Bearer ${auth}` });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably overwrote the setForwardedHeaders above.

@SleeplessOne1917
Copy link
Member

Regarding cross-fetch: newer versions of node (I think 18 and above) include a fetch API that works the same as the browser one.

@SleeplessOne1917 SleeplessOne1917 enabled auto-merge (squash) November 29, 2023 02:15
@SleeplessOne1917 SleeplessOne1917 merged commit 5ec9baa into main Nov 29, 2023
@dessalines
Copy link
Member Author

Sweet. I'll start another lemmy-ui deploy for testing.

@SleeplessOne1917 SleeplessOne1917 deleted the ssr_fix_1 branch November 29, 2023 08:25
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 this pull request may close these issues.

2 participants