Open danieltroger opened 10 months ago
@Kayeddy not sure how your comment relates to this issue? There's no mongodb or JSON.stringify here
Was running into the same issues:
npm run build
no issuesNow successfully working with:
Doesn't work if you don't have sharp installed for some reason, even though I found conflicting information from several Github issues.
@Kayeddy not sure how your comment relates to this issue? There's no mongodb or JSON.stringify here
My apologies for the oversight, I kind of confused the context of the issue with another issue I saw on Stack Overflow.
Kind regards.
I'm getting a similar kind of error. Don't know what's the issue.
@SujithPriyamRajan you're probably calling a component recursively, maybe the error message I detailed under "Expected behavior" helps explaining it?
@SujithPriyamRajan you're probably calling a component recursively, maybe the error message I detailed under "Expected behavior" helps explaining it?
I’m curious about this issue. Everything was working fine when using the client-side API, but since I moved the API to the server side, I’ve been facing problems with downloading blobs and creating window.URL.createObjectURL(blob)
"use client"
const response = await api.viewDownload.download(path, FileTypes.CSV, details?.applicationName);
const blobType = Object.getOwnPropertyDescriptor(response.headers, 'content-type')?.value;
const blob = new Blob([response.data], {
type: blobType
});
const url = window.URL.createObjectURL(blob);
"use server"
const response = await axios({
url: fetchUrl.startsWith(config.REACT_APP_API_ENDPOINT) ? fetchUrl : '',
method: options?.method,
headers: options?.method?.toLowerCase() === 'get' ? { Accept: 'application/json' } : headers,
data: options?.body
});
return options?.responseType === ResponseTypes.BLOB ? response : response.data.detail;
I have tried with https://github.com/vercel/next.js/issues/58494#issuecomment-1942427098
My current version is "next": "14.2.3"
Link to the code that reproduces this issue
https://github.com/danieltroger/react-server-components-stuff/tree/dt/next_infinite_loop
To Reproduce
git clone git@github.com:danieltroger/react-server-components-stuff.git
cd react-server-components-stuff
git checkout dt/next_infinite_loop
yarn build
Current vs. Expected behavior
Current behavior:
Expected behavior:
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
I wasted an embarrassingly long time on stepping through react internals for this (the function in the stack trace of the error that infinite loops' source code is here https://github.com/facebook/react/blob/593ecee66a609d4a4c2b36b39b1e5e23b2456dd1/packages/react-server/src/ReactFizzServer.js#L2168) when it's actually my fault. The reason this happened is because I forgot an import here: https://github.com/danieltroger/react-server-components-stuff/blob/dt/next_infinite_loop/app/components/SearchPage.tsx (it should be
import { SearchPage } from "@depict-ai/react-ui"
)BUT the reason I'm reporting this as a bug is because my feeling is that next/react has the philosophy of displaying user friendly error messages when doing something wrong (I partly blame that I introduced this on running into
5:16 Error: Component definition is missing display name react/display-name
so I called the function something without thinking about it). And I think this error message is the absolute opposite of user friendly. It leaves someone encountering this two options: debugging react, which leads to nothing because the variables in scope where it infinite loops aren't helpful or just changing random things in ones app until one discovers the infinite loop.Both are not optimal. I'd love to see an improved error message, as detailed in the
Expected behavior
section