Troubleshooting
The errors you can meet while installing, building or editing the site, what causes each one, and how to fix it.
Docker is not running
failed to connect to the docker API at unix:///…/docker.sock; check if the path is correct and if the daemon is runningOlder Docker versions say "Cannot connect to the Docker daemon" instead. Either way, the Docker engine is not started.
Open Docker Desktop
Start Docker Desktop and wait until it reports that the engine is running. On Linux, start the service:
sudo systemctl start docker.Check that Docker answers
Terminaldocker infoExpected result: It prints a Server section instead of an error.
Run your command again
docker build -t analytics-landing ., thendocker run -p 3030:3030 analytics-landing.
A port is already in use
Bind for 0.0.0.0:3030 failed: port is already allocated
ports are not available: exposing port TCP 0.0.0.0:3030 … bind: address already in use
Error: listen EADDRINUSE: address already in use :::3030The first two lines come from Docker, the last from yarn dev or yarn start. Another program already listens on port 3030: often an earlier run of this site, or another project's server.
Find what holds the port
On macOS or Linux:
Terminallsof -i :3030On Windows, in PowerShell:
Terminalnetstat -ano | findstr :3030Stop it
Close that program, or stop the earlier run: Ctrl+C in its terminal, or
docker stopwith the container's ID fromdocker ps. Then start the site again.Or use another port
Keep the other program and start the site on a free port, here
3041:How you run it Command Docker docker run -p 3041:3030 analytics-landingDevelopment server yarn dev -p 3041Production build yarn start -p 3041With Docker, change only the number on the left of
-p: the site inside the container always listens on3030.Expected result: The site answers on localhost:3041/enLocal.
The build fails
docker build stops with "failed to solve" and the step that failed; yarn build stops with the error itself. The usual causes:
- No connection or a timeout: the build downloads the dependencies, and the DM Sans, Noto Sans Arabic and Almarai fonts from Google Fonts. A message such as "Failed to fetch
DM Sansfrom Google Fonts." means the build could not reach them. Run the command again once you are online; with Docker, finished steps are cached. - `Invalid URL`:
NEXT_PUBLIC_SITE_URLis not a full address. Write it withhttps://, such ashttps://www.your-domain.com. - No space left on device: free space in Docker Desktop, or check what Docker uses with
docker system df. - It fails at the same step every time: build again without the cache.
Nextjs-landing-page-template-2docker build --no-cache -t analytics-landing .Without Docker, delete the node_modules and .next folders, then run yarn install and yarn build again.
Yarn says its version is 1.22
This project's package.json defines "packageManager": "yarn@4.8.1…". However the current global version of Yarn is 1.22…The project pins Yarn 4 through Corepack. This message means Corepack is not enabled yet, so an old global Yarn answered instead.
corepack enableThen run yarn install again. Use Yarn rather than npm: yarn.lock is what keeps your install on the versions the template was tested with.
The corepack command is not found
corepack: command not foundNode.js 25 and newer no longer include Corepack. Install it once with npm, then turn it on:
npm install -g corepack
corepack enableThen run yarn install again. The same two commands fix yarn: command not found.
Node.js is too old
You are using Node.js 18.20.4. For Next.js, Node.js version ">=20.9.0" is required.Next.js 16 needs Node.js 20.9 or newer. Check your version with node -v. Install Node.js 22 or 24, open a new terminal, run corepack enable again, then yarn install and yarn dev.
With Docker this does not apply: the image brings its own Node.js 24.
A changed setting does nothing
NEXT_PUBLIC_SITE_URL and the other NEXT_PUBLIC_ values are compiled into the site when it is built. Changing one changes nothing until the site is built again.
| How you run it | After changing a value |
|---|---|
yarn dev | Change it in .env.local, stop the server and run yarn dev again. |
yarn build and yarn start | Change it in .env.local, run yarn build again, then yarn start. |
| Docker | Build the image again with the value as a --build-arg. The image build ignores .env and .env.local. |
| Vercel | Change it in the project's Environment Variables and deploy again. |
yarn start fails, or shows an old version
Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server.yarn start serves the last production build, from the .next folder. Run yarn build first, and again after every change.
If the site shows errors that do not match your code, often after you changed a dependency's version or BUILD_STANDALONE, delete the .next folder and build again:
Nextjs-landing-page-template-2rm -rf .next
yarn buildOn Windows, in PowerShell, delete it with Remove-Item -Recurse -Force .next.
A form says it was sent, but nothing arrives
That is how the template ships. The forms check what visitors type and show their success message, but they send nothing anywhere until you connect each one you keep to your own service.
A new colour theme does not show in development
With yarn dev, a floating panel lets you preview the four colour themes, and the browser remembers the one you picked there. That choice wins over the theme set in the code. Pick the same theme in the panel, or clear the site data for localhost:3030 in your browser.
A production build, with yarn start or Docker, never shows the panel and always uses the theme set in the code.
The site opens in Arabic
Opening / sends a visitor to /ar when the browser prefers Arabic, and to /en otherwise. Choose the other language in the header's language menu, or open /en directly.
A link goes nowhere
Some footer links, the social icons and the contact page's social links point to # placeholders. That is by design: they are yours to point at your own pages and profiles. The header, the pricing, blog and contact links, and the sign-up buttons already work.
The folder looks different
Run the commands inside the folder the ZIP extracts to, Nextjs-landing-page-template-2. It holds Dockerfile, package.json, yarn.lock, messages, public and src. If the unzip command is missing, extract it with your file manager instead; some tools add an extra folder named after the ZIP, so move into the inner one.