question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot destructure property 'inAmpMode'

See original GitHub issue

Cannot destructure property 'inAmpMode' of '(0 , _react).useContext(...)' as it is null. at Html (webpack-internal:///./node_modules/Next/dist/pages/_document.js:168:13)

This error handled in a starter project by tutorial. Without module i don’t have an error. System: Mac os 12 arm

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
tahmeednabicommented, May 15, 2022

For anyone wanting to use latest version of next, I solved the issue for myself.

I was trying to recreate the monorepo example of the next-next project, however, with the latest version of next, both server and client need to be using the same next module, so I simply ran yarn remove next in both client and server, and yarn add next in the root repository. Should work fine after that.

0reactions
javeoffcommented, Sep 15, 2021

Issue in next version, just change to “next”: “^11.0.1”, Problem can be closed. Thank you for your attention, Kyle! If you will understand why in the last next version error is thrown, pls, create issue there, thanks)

Read more comments on GitHub >

github_iconTop Results From Across the Web

'inAmpMode' of '(0 , _react).useContext(...)' as it is null. #30602
next dev works fine, but running a production build using next start give me the TypeError: Cannot destructure property 'inAmpMode' of '(0 ,...
Read more >
Cannot destructure property `html` of 'undefined' or 'null' in ...
Following is my code. import React from 'react'; import Document, {Head, Html, Main, NextScript} from "next/document"; import {ServerStyleSheets} ...
Read more >
Next.js error: Cannot destructure property? : r/learnjavascript
I am following a tutorial and I cannot figure out why Next keeps throwing this error: TypeError: Cannot destructure property 'loginUser' of ...
Read more >
'inAmpMode' of '(0 , _react).useContext(...)' as it is null. 에러처리
2021-10-29T07:07:33.538Z 1c7003b2-3f04-407b-b1e6-fabf99ed1f8a ERROR TypeError: Cannot destructure property 'inAmpMode' of '(0 , _react).
Read more >
cannot read property 'usecontext' of null nextjs - You.com
This gives the error: TypeError: Cannot read property 'pathname' of null. The call stack shows: getInitialProps pages\marketplace\index.js (73:46). If I remove ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found