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
TypeError: Cannot read property 'map' of undefined #12668
Comments
|
you are passing |
|
Thanks @kartikpandey2 , One question, suggestion: Why doesn't NextJs show me exactly where the problem is? and instead, it offers me an error that is in another file? |
|
In this case it broke because you destructured "use strict";
exports.__esModule = true;
exports.default = App;
function App({
Component,
pagePros
}) {
return /*#__PURE__*/React.createElement(Component, pagePros);
}
We don't control the props passing (React does) so we can't really warn here automatically if you destructure the wrong value. However if you were using TypeScript which does type checking on objects it would have shown you an error because of using a value that did not exist in the props. Here's the documentation for using TypeScript: https://nextjs.org/docs/basic-features/typescript and the specific _app types: https://nextjs.org/docs/basic-features/typescript#custom-app In that case (when using TypeScript) typescript will type-check I'll close this issue as it's not something we can detect as-is and the right way to go about it would be to adopt TypeScript in your app. |
|
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
TypeError: Cannot read property 'map' of undefined, when following the Nextjs official tutorial
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Follow the NextJs tutorial using
nextjs 9.3.6andyarnThe tutorial can be found here
Expected behavior
To work and generate static content from markdown files to the blog in the nextjs tutorial
System information
Kubuntu 19.10(Ubuntu flavor) Linux
Browser Firefox, Chromium(Google Chrome for Linux- opensource)
Additional context
Created the whole project used to generate the error and posted it on Github, so you can reproduce it or reference it.
Project
The text was updated successfully, but these errors were encountered: