Challenge - 5 Problems
Node Adapter Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediate2:00remaining
What happens when you run a SvelteKit app with the Node adapter?
You have built a SvelteKit app and configured it to use the Node adapter. What is the expected behavior when you run
node build/index.js?Attempts:
2 left
💡 Hint
Think about what the Node adapter is designed to do in SvelteKit.
✗ Incorrect
The Node adapter builds your SvelteKit app into a Node.js server that you can run with
node build/index.js. It serves your pages and API endpoints dynamically.📝 Syntax
intermediate2:00remaining
Which configuration snippet correctly sets up the Node adapter in SvelteKit?
You want to deploy your SvelteKit app using the Node adapter. Which
svelte.config.js snippet is correct?Attempts:
2 left
💡 Hint
The adapter function must be called to create the adapter instance.
✗ Incorrect
The Node adapter is a function that you must call, optionally with options, to create the adapter instance. So
adapter({}) is correct.🔧 Debug
advanced2:00remaining
Why does the SvelteKit app fail to start after deploying with the Node adapter?
You deployed your SvelteKit app with the Node adapter and ran
node build/index.js. The server crashes with the error: Cannot find module 'polka'. What is the most likely cause?Attempts:
2 left
💡 Hint
Check if the adapter requires any extra dependencies.
✗ Incorrect
The Node adapter uses Polka internally, so you must have Polka installed in your project dependencies. Missing it causes this error.
❓ state_output
advanced2:00remaining
What is the effect of setting
out option in the Node adapter configuration?Consider this configuration snippet:
adapter({ out: 'custom_build' })
What happens when you run npm run build?Attempts:
2 left
💡 Hint
The
out option controls the output folder location.✗ Incorrect
The
out option tells the Node adapter where to put the build files. Setting it to custom_build changes the output folder accordingly.🧠 Conceptual
expert3:00remaining
Why choose the Node adapter over the Static adapter for deployment?
You want to deploy a SvelteKit app that has dynamic server-side logic and API endpoints. Why is the Node adapter the better choice compared to the Static adapter?
Attempts:
2 left
💡 Hint
Think about whether your app needs server-side code running at runtime.
✗ Incorrect
The Node adapter creates a Node.js server that can run dynamic code and API endpoints. The Static adapter only generates static HTML and assets, so it cannot handle server-side logic.