Bug: `FileTreePreparedInput` contains a `Symbol` key and is not serializable
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- next.js, react, typescript
- Domain
- frontend
Research direction
Start by reading the definitions of FileTreePreparedInput and prepareFileTreeInput, then trace how the prepared input is passed across the React Server Component boundary. Reproduce the reported serialization error with the Server Component and Client Component examples in the issue. Done means the prepared input can cross that boundary without the Symbol-property error; an open linked pull request indicates work is already underway.
Written by the indexing model from the issue text.
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have read the contributing guidelines
Describe the issue
FileTreePreparedInput includes a Symbol-keyed property (pathStorePreparedInputKind), making it non-serializable.
Passing this object from a Next.js Server Component to a Client Component triggers a serialization error, as Symbol values cannot cross the React Server Component (RSC) boundary.
Reproduction
page.tsx (Server Component):
export default async function Page({ params }: { params: Promise<{ projectId: string }> }) {
const { projectId } = await params;
const paths = await fetchProjectPaths(projectId);
const preparedInput = prepareFileTreeInput(paths);
return <FileTreeClient preparedInput={preparedInput} />;
}
file-tree.tsx (Client Component):
'use client';
export function FileTreeClient({ preparedInput }: { preparedInput: FileTreePreparedInput }) {
const { model } = useFileTree({ preparedInput });
return <FileTree model={model} />;
}
Error output:
Error: Only plain objects can be passed to Client Components from Server Components. Objects with symbol properties like pathStorePreparedInputKind are not supported.
{preparedInput: {paths: ..., preparedPaths: ...}}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What browser(s) are you seeing the problem on?
No response
What version of @pierre/diffs are you using?
1.0.0-beta.6
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 226
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 33
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pierrecomputer/pierre
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pierrecomputer/pierre#1187 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pierrecomputer/pierre#1150 · 3 comments ·
Maintainers usually reply within 1 day
-
Bug: Dragging a selection past the edge of an editable CodeView collapses it, then stops it growingOpenbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pierrecomputer/pierre#1189 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
pierrecomputer/pierre#1184 · 4 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 63/100
pierrecomputer/pierre#1172 ·
Maintainers usually reply within 1 day
All issues in pierrecomputer/pierre
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 70/100
lingdojo/kana-dojo#32590 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
bug p2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bastani-inc/atomic#3703 ·
Maintainers usually reply within 1 day
-
backend bug difficulty: medium priority: medium reliability
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
trustflow-protocol/trustflow-backend#730 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
firecrawl/firecrawl-mcp-server#548 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day