#I never created a next.js app with the preset, is that a problem 🤔
1 messages · Page 1 of 1 (latest)
Hi @hoary temple. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
😐
The error message "TypeError: Cannot read properties of null" is a common JavaScript error that occurs when you try to access a property or method on a value that is null or undefined. In the context of Next.js, this error often occurs when there's an issue with the rendering of your pages.
Based on the knowledge sources provided, it seems that this error is often associated with the useContext hook in Next.js. This could mean that somewhere in your code, you're trying to use a context that hasn't been properly initialized.
As for your question about creating a Next.js app without a preset, it's not necessarily a problem. When you create a new Next.js project, you can choose a framework preset, which sets up a basic configuration for your project based on the chosen framework. However, if you choose "Other" as the Framework Preset, you can use null as shown in the Vercel documentation (https://vercel.com/docs/projects/project-configuration#framework). This means that no specific configuration will be applied, and you can set up your project as you see fit.
{
"framework": "nextjs"
}
However, if you're encountering issues, it might be worth considering using a preset, as it could help set up some sensible defaults and potentially avoid some common pitfalls.
If you're still encountering the error, I would recommend checking your usage of the useContext hook and ensuring that all contexts are properly initialized. If the problem persists, you might want to consider opening an issue in the Next.js GitHub repository (https://github.com/vercel/next.js/issues) to get help from the community.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@hoary temple kapa.ai is still learning and improving, please let us know how it did by reacting below