Merged
Conversation
main
| import { Metadata } from "next" | ||
| import { HydrationBoundary, dehydrate } from "@tanstack/react-query" | ||
| import { articleQueries } from "api/hooks/articles" | ||
| import { articleQueries } from "api/hooks/articles/queries" |
Contributor
Author
There was a problem hiding this comment.
This file is a React "server component", which is where server-side data fetching in NextJS happens. Because it's a server component, it has some restrictions about what hooks can be used or even imported.
- The file
api/hooks/articlesimportsuseRef, which is client-only. Consequently, i cannot be used in a react-server component, and causes the build to fail. - Why not caught on PR CI checks?: Both this import and the
useRefwere merged into main fairly recently. The PR that added useRef (b793fa3) was slightly out-of-date and shouldve been rebased before merging.- Maybe should consider enabling merge queue? https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue Dunno how much that would slow down merging, though
The fix is to change the file to import articleQueries more directly; the articleQueries object itself never needs those hooks. Just some mutations (not used in this file, never used on the server) were getting incidentally imported.
jonkafton
approved these changes
Jan 13, 2026
This was referenced Jan 13, 2026
Closed
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
None
Description (What does it do?)
Fixes failing build on
main.How can this be tested?
Tests should pass.