Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Docs: Upgrade Nextjs with --api Usage #77238

Closed
prashantchothani opened this issue Mar 18, 2025 · 1 comment
Closed

Docs: Upgrade Nextjs with --api Usage #77238

prashantchothani opened this issue Mar 18, 2025 · 1 comment

Comments

@prashantchothani
Copy link

What is the documentation issue?

With 15.2.2, Nextjs can be used as a backend with --api option while installing. Like us, many were using Nextjs as a backend API and that is why I was chasing on having this option. Finally it is there. When i tried to upgrade the current project by removing React and React DOM in package.json making it exactly same as the fresh project, the build is not happening. The error I am getting is : Error: Cannot find module 'react'. How do we change our current project which does not have any front end component to --api project ? This needs to be documented please.

Is there any context that might help us understand?

Upgrading Nextjs backend project to --api

Does the docs page already exist? Please link to it.

No response

@kevinmitch14
Copy link
Contributor

TypeError: Cannot read properties of null (reading 'useContext')
at g (.next/server/pages/_error.js:1:7386)
Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
at exports.useContext (/Users/code/node_modules/.pnpm/react@19.0.0-rc-04bd67a4-20240924/node_modules/react/cjs/react.production.js:489:33)
at g (/Users/code/auth-api/.next/server/pages/_error.js:1:7386)
at renderWithHooks (/Users/code/auth-api/node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4189:18)
at renderElement (/Users/code/auth-api/node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4327:14)
at retryNode (/Users/code/auth-api/node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4871:16)
at renderNodeDestructive (/Users/code/auth-api/node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/cjs/react-dom-server.edge.production.js:4689:7)
at renderNode (/Users/code/auth-api/node_modules/.pnpm/react-dom@19.0.0_react@19.0.0/node_modules/react-dom/cjs/react-dom-server.edge.production.js:5128:14)

@ztanner ztanner added please add a complete reproduction Please add a complete reproduction. and removed please add a complete reproduction Please add a complete reproduction. labels Mar 21, 2025
@vercel vercel locked and limited conversation to collaborators Mar 21, 2025
@ztanner ztanner converted this issue into discussion #77393 Mar 21, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants