Challenge - 5 Problems
Next.js Setup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
Correct command to create a new Next.js app
Which command correctly creates a new Next.js app named
my-app using the official recommended method?Attempts:
2 left
💡 Hint
Use the official Next.js recommended command with npx.
✗ Incorrect
The official way to create a new Next.js app is using 'npx create-next-app@latest my-app'. Other commands are either invalid or deprecated.
❓ component_behavior
intermediate2:00remaining
Default page output after creating a Next.js app
After running
npx create-next-app@latest my-app and starting the development server, what will the default homepage display?Attempts:
2 left
💡 Hint
The default app includes a friendly welcome page.
✗ Incorrect
The default Next.js app shows a styled welcome page with the Next.js logo and helpful links to get started.
🔧 Debug
advanced2:00remaining
Fixing a missing dependency error after setup
You created a Next.js app with
npx create-next-app@latest my-app but running npm run dev gives an error: Cannot find module 'react'. What is the most likely cause?Attempts:
2 left
💡 Hint
Dependencies must be installed before running the app.
✗ Incorrect
The error means React is missing. Running
npm install installs all dependencies including React.🧠 Conceptual
advanced2:00remaining
Understanding the role of the
pages directoryIn a freshly created Next.js app, what is the main purpose of the
pages directory?Attempts:
2 left
💡 Hint
Think about how URLs relate to files in Next.js.
✗ Incorrect
Next.js uses the
pages folder to create routes automatically based on file names.❓ state_output
expert2:00remaining
Effect of editing
app/page.tsx in Next.js 14 app routerIn a Next.js 14 app created with the app router, you edit
app/page.tsx to add a console.log('Hello') inside the default exported component function. What happens when you refresh the homepage in the browser?NextJS
export default function Page() { console.log('Hello'); return <h1>Welcome</h1>; }
Attempts:
2 left
💡 Hint
Remember that Next.js 14 app router components run on the server by default.
✗ Incorrect
In Next.js 14 app router, components are server components by default, so console.log runs on the server, not in the browser.