TypeError: Cannot read property 'amp' of null
See original GitHub issueWhen upgrading from next 8.0.3 to 8.1.0 I get the following error when compiling any page:
[ error ] TypeError: Cannot read property 'amp' of null
at Object.renderToHTML (/usr/app/enrola-webapp/node_modules/next-server/dist/server/render.js:169:33)
at process._tickCallback (internal/process/next_tick.js:68:7)
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'map' of null - Stack Overflow
the answer is very simple: the type of the input isn't array type, it might be null or undefined . so that it...
Read more >TypeError: Cannot read property 'map' of null in React.js
The "cannot read property 'map' of null" error occurs when we call the map() method on a null value, most often when initializing...
Read more >How to Prevent the TypeError: Cannot Read Property Map of ...
A guide on the root cause of 'cannot read map of undefined' as well as techniques and tools to prevent this error.
Read more >Type error: cannot read property 'map' of null - react JS
How have you defined products is still not clear. I can just guess that its initialized as null in your component and that...
Read more >Fix the "Cannot read property 'map' of undefined" Error in React
The variable you are trying to map over is undefined . It will probably eventually be an array, but due to the asynchronous...
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

In my case I solved like this:
To add my 2 cents in here, I had the same issue with 8.1.0 and 9.x the root cause I found in my case was that
url.parsereturns the urlObject withquery=null. Then any default value passed as( query = {} )was not defaulted to{}and then the check ofquery.ampin 9.x throws.In my case I have a custom server, so it’s quite simple to fix it by just checking for null and making the default to
{}.Not sure thou how to reproduce this in a plain example.