meteor / meteor/react-packages

react-meteor-accounts not working with SSR

Open
#364 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
575
Forks
168
Avg merge
4d 3h
Merged PRs (30d)
1

Description

Hey,
when adding the useUserId() hook to my component, I get the following error:

```
Error running template: Error: Meteor.userId can only be invoked in method calls or publications.
```

We are running the latest Meteor version with React 18.

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

No source file or test is named in the issue. Start by reproducing the useUserId() failure in a React 18 server-rendered component with the latest Meteor version, then trace the React accounts integration; done means the hook works during SSR without the reported Meteor.userId error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
authentication, full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.