-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Preact: Error message about circular structure when using <Head> in Next 9.5.4+ #17854
Comments
I didn't find or know about this issue before opening developit/nextjs-preact-demo#25 |
This issue can be resolved by adding Until then either stay with an older version of next.js or try out Edit: |
Thank you @sventschui for maintaining this plugin, I confirm that the issue is fixed now with the update of |
Just a note: I found that adding |
You could import it only on development. if (process.env.NODE_ENV === 'development') {
require('preact/debug');
} |
This issue was solved by reverting the changes to |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
Hi, when using
<Head>
in a Next.js project that usespreact
instead ofreact
the following error is displayed:It seem like the underlying issue is not
getInitialProps
, but instead the issue is caused by a__self
reference in__NEXT_DATA__.head
.The problem was introduced by this PR #16758:
head
is now part of__NEXT_DATA__
, which is not compatible withpreact
.preact
attaches a__self
and__source
property to elements, which is causing a circular dependency error, when serializing__NEXT_DATA__
, since__self
will point to an object that has circular dependencies.To Reproduce
9.5.5
(eg.ncu -u && npm i
)npm run dev
http://localhost:3000/bug
Inspecting
__NEXT_DATA__
, it will look like this, with the circular dependency inhead
:Expected behavior
preact
__self
and__source
should be removed before head-elements to__NEXT_DATA__
Screenshots
System information
The text was updated successfully, but these errors were encountered: