next/head crashes app
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
next info
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Wed Oct 26 2022 00:51:29 GMT-0300 (Horário Padrão de Brasília)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 12.3.2-canary.43
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
firefox
How are you deploying your application? (if relevant)
next dev
Describe the Bug
When using the Head component, this error is thrown in the console:
TypeError: Cannot read property '' of undefined
at resolveModuleReference (C:\projects\javascript\personal\edp-totem\node_modules\next\dist\compiled\react-server-dom-webpack\client.js:46:58)
at resolveModule (C:\projects\javascript\personal\edp-totem\node_modules\next\dist\compiled\react-server-dom-webpack\client.js:646:25)
at processFullRow (C:\projects\javascript\personal\edp-totem\node_modules\next\dist\compiled\react-server-dom-webpack\client.js:735:9)
at processBinaryChunk (C:\projects\javascript\personal\edp-totem\node_modules\next\dist\compiled\react-server-dom-webpack\client.js:789:5)
at progress (C:\projects\javascript\personal\edp-totem\node_modules\next\dist\compiled\react-server-dom-webpack\client.js:842:5)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Expected Behavior
To work properly without any errors
Link to reproduction
https://stackblitz.com/edit/vercel-next-js-vjs4ah?file=src/app/layout.tsx
To Reproduce
Create a root layout in app folder that adds a Head component
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Using the Next.js Head component outside of _document ...
It turns out that when using heads outside the document definition, you need to import them from "next/head" instead of "next/document" . Share....
Read more >Why this nextjs code is crashing ? - YouTube
hiteshChoudhary.com Download LearnCodeOnline.in app from Google play store and Apple App store https://play.google.com/store/ apps /de.
Read more >Advanced Features: Error Handling - Next.js
Handle errors in your Next.js app. ... In addition to preventing the page from crashing, it allows you to provide a custom fallback...
Read more >A 2021 Crash Course in Next.js
A 2021 Crash Course in Next.js · Server-Side Rendering Unlike a traditional React app where the entire application is loaded and rendered on...
Read more >How To Fix Android Messages Keeps Crashing - The Droid Guy
If the Android Messages app keeps stopping or crashing and you have no ... Next, head over to your device's Settings > System...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@darklight9811 After some digging around I noticed that the new way to use this is creating a
head.tsx
file next to the page: https://beta.nextjs.org/docs/routing/pages-and-layouts#modifying-headNot fully sure what I think about it yet though 😅 It’s nice… But having these extra files is also not? 😬
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.