Engineering Tools for AI

Lập trình

Thuật ngữ dev server và triển khai

Tra cứu server cục bộ, URL mạng, port, build, deploy, cảnh báo và lỗi web thường gặp.

42 mục

Phát triển cục bộ

localhost

localhost

http://localhost:3001

Ý nghĩa

A hostname that points back to the same computer that is running the browser or command.

Cách dùng

Use localhost when checking the site on the same Mac or PC where the dev server is running.

Lưu ý

A phone or tablet has its own localhost, so it cannot use your Mac's localhost address.

Ví dụ

http://localhost:3001

Ví dụ yêu cầu

Open the local site at localhost and check the new reference page.

Phát triển cục bộ

127.0.0.1

127.0.0.1

http://127.0.0.1:3001

Ý nghĩa

A loopback IP address that also points to the same local computer.

Cách dùng

It is often interchangeable with localhost for same-device testing.

Ví dụ

http://127.0.0.1:3001

Ví dụ yêu cầu

Try 127.0.0.1 if localhost does not resolve correctly.

Phát triển cục bộ

Dev server

Dev server

npm run dev

Ý nghĩa

A server used while developing, with fast rebuilds and development-only features.

Cách dùng

Use it to preview changes before building or deploying the site.

Lưu ý

Dev server behavior is not always identical to deployed production behavior.

Ví dụ

npm run dev

Ví dụ yêu cầu

Start the dev server so I can check the page on my iPhone.

Phát triển cục bộ

Port

Port

http://localhost:3001

Ý nghĩa

A number that identifies which server process should receive the connection on a machine.

Cách dùng

If one server uses port 3001, another server must use a different port such as 3002.

Ví dụ

http://localhost:3001

Ví dụ yêu cầu

If port 3001 is already in use, start the dev server on another port.

Phát triển cục bộ

Local URL

Local URL

Local: http://localhost:3001

Ý nghĩa

The address used from the same device where the dev server is running.

Cách dùng

Use Local URL for desktop browser checks on the development machine.

Ví dụ

Local: http://localhost:3001

Ví dụ yêu cầu

Tell me the Local URL after starting the dev server.

Truy cập mạng

Network URL

Network URL

Network: http://172.30.1.55:3001

Ý nghĩa

An address other devices on the same network can use to reach the dev server.

Cách dùng

Use it when checking the site from an iPhone, iPad, or another computer on the same Wi-Fi.

Lưu ý

The dev server must listen on a network-accessible host such as 0.0.0.0.

Ví dụ

Network: http://172.30.1.55:3001

Ví dụ yêu cầu

Start the dev server with a Network URL so I can test it on my iPad.

Truy cập mạng

IP address

IP address

172.30.1.55

Ý nghĩa

A numeric address that identifies a device on a network.

Cách dùng

A LAN IP lets another device on the same Wi-Fi reach your dev server.

Lưu ý

Local network IPs can change when Wi-Fi or router conditions change.

Ví dụ

172.30.1.55

Ví dụ yêu cầu

Use the current LAN IP when adding allowedDevOrigins for device testing.

Truy cập mạng

Host

Host

--hostname 0.0.0.0

Ý nghĩa

The address a server binds to when it starts listening for requests.

Cách dùng

Binding to 0.0.0.0 allows the dev server to be reachable from other devices on the network.

Ví dụ

--hostname 0.0.0.0

Ví dụ yêu cầu

Run the dev server with hostname 0.0.0.0 for phone testing.

Truy cập mạng

Same network

Same network

Mac and iPhone on the same Wi-Fi

Ý nghĩa

Devices connected to the same local network, usually the same Wi-Fi router.

Cách dùng

A phone can reach your Mac's dev server only when network settings allow it.

Ví dụ

Mac and iPhone on the same Wi-Fi

Ví dụ yêu cầu

Check that the iPhone and Mac are on the same network before debugging the site.

Hành vi Next.js

allowedDevOrigins

allowedDevOrigins

allowedDevOrigins: ['172.30.1.55']

Ý nghĩa

A Next.js development setting that allows specific origins to access development resources.

Cách dùng

It can be needed when testing a Next dev server from a phone or tablet using a LAN IP.

Lưu ý

This is a development setting. Deployed static sites do not use the same dev-resource access path.

Ví dụ

allowedDevOrigins: ['172.30.1.55']

Ví dụ yêu cầu

Add my current LAN IP to allowedDevOrigins for development testing.

Truy cập mạng

Cross-origin

Cross-origin

Blocked cross-origin request

Ý nghĩa

A request between different origins, where scheme, host, or port differs.

Cách dùng

Development tools may block cross-origin access to sensitive dev resources by default.

Ví dụ

Blocked cross-origin request

Ví dụ yêu cầu

Explain whether this cross-origin warning affects production deployment.

Hành vi Next.js

HMR

HMR

/_next/webpack-hmr

Ý nghĩa

Hot Module Replacement updates the browser during development without a full reload.

Cách dùng

If HMR dev resources are blocked, the page may load but interactive updates or scripts can behave strangely in development.

Lưu ý

HMR is development-only and is not part of the final static export.

Ví dụ

/_next/webpack-hmr

Ví dụ yêu cầu

Check whether the iPhone issue is caused by blocked HMR dev resources.

Hành vi Next.js

Turbopack

Turbopack

Next.js 16.2.5 (Turbopack)

Ý nghĩa

A bundler used by Next.js for development and build workflows.

Cách dùng

You may see its name in dev server or build output.

Ví dụ

Next.js 16.2.5 (Turbopack)

Ví dụ yêu cầu

Summarize the Turbopack output and tell me whether the build succeeded.

Hành vi Next.js

App Router

App Router

src/app/[locale]/reference/page.tsx

Ý nghĩa

The Next.js routing system based on the app directory.

Cách dùng

Adding a page.tsx file under a folder creates a route.

Ví dụ

src/app/[locale]/reference/page.tsx

Ví dụ yêu cầu

Add the new reference page using the App Router folder structure.

Hành vi Next.js

generateStaticParams

generateStaticParams

generateStaticParams()

Ý nghĩa

A Next.js function that declares which dynamic routes should be generated at build time.

Cách dùng

Locale pages use it to create /en, /ko, /ja, and other language paths.

Ví dụ

generateStaticParams()

Ví dụ yêu cầu

Make sure the new reference page has generateStaticParams for all locales.

Build và đầu ra

Build

Build

npm run build

Ý nghĩa

The process that compiles and prepares the site for production or static output.

Cách dùng

Run build before deployment to catch TypeScript, route, and static generation problems.

Ví dụ

npm run build

Ví dụ yêu cầu

Run the build and confirm the new route is generated.

Build và đầu ra

Lint

Lint

npm run lint

Ý nghĩa

A static code check that catches style, correctness, and framework-rule issues.

Cách dùng

Lint is a quick check before build or commit.

Ví dụ

npm run lint

Ví dụ yêu cầu

Run lint after editing the reference pages.

Build và đầu ra

Static export

Static export

output: "export"

Ý nghĩa

A build output where pages are generated as static files instead of needing a running server.

Cách dùng

Static export is useful for hosting sites as prebuilt HTML, CSS, and JavaScript files.

Lưu ý

Some server-only features do not work with static export.

Ví dụ

output: "export"

Ví dụ yêu cầu

Keep the new page compatible with static export.

Build và đầu ra

SSG

SSG

● (SSG) prerendered as static HTML

Ý nghĩa

Static Site Generation creates pages at build time.

Cách dùng

Reference pages with generateStaticParams are generated for each locale during build.

Ví dụ

● (SSG) prerendered as static HTML

Ví dụ yêu cầu

Confirm that the reference route appears as SSG in the build output.

Build và đầu ra

Prerender

Prerender

prerendered as static content

Ý nghĩa

Rendering a page before a user requests it, usually during build.

Cách dùng

Prerendered pages load fast because HTML already exists.

Ví dụ

prerendered as static content

Ví dụ yêu cầu

Check that all locale pages are prerendered successfully.

Build và đầu ra

Bundle

Bundle

static JS bundle

Ý nghĩa

Compiled files that combine code and dependencies for the browser.

Cách dùng

Large bundles can affect load speed and should be watched as the site grows.

Ví dụ

static JS bundle

Ví dụ yêu cầu

Avoid adding a heavy library just for a simple reference page.

Triển khai

Deploy

Deploy

deploy static output

Ý nghĩa

Publishing the built site so users can access it on the web.

Cách dùng

Deployment happens after local checks, lint, and build pass.

Ví dụ

deploy static output

Ví dụ yêu cầu

Do not deploy yet; just prepare the page and run build.

Triển khai

Production

Production

production deployment

Ý nghĩa

The real deployed environment that users access.

Cách dùng

Production should be tested differently from the local dev server because dev-only features are absent.

Ví dụ

production deployment

Ví dụ yêu cầu

Explain whether this warning affects production or only development.

Triển khai

Hosting

Hosting

static hosting provider

Ý nghĩa

The service or server that stores and serves the deployed site files.

Cách dùng

Static export can be served by static hosting when server logic is not required.

Ví dụ

static hosting provider

Ví dụ yêu cầu

Make sure the output works on static hosting.

Triển khai

Domain

Domain

example.com

Ý nghĩa

The human-readable address users type to reach a site.

Cách dùng

A domain points to the deployed hosting location through DNS.

Ví dụ

example.com

Ví dụ yêu cầu

Do not hard-code localhost in links that should work on the production domain.

Triển khai

DNS

DNS

A record / CNAME record

Ý nghĩa

The system that maps a domain name to the server or hosting target.

Cách dùng

DNS must be configured correctly for a custom domain to reach the deployed site.

Ví dụ

A record / CNAME record

Ví dụ yêu cầu

Explain whether the issue is a DNS problem or an app build problem.

Triển khai

Cache

Cache

clear browser cache

Ý nghĩa

Stored copies of files or responses used to load pages faster.

Cách dùng

After deployment, old cached files can make a browser show a previous version for a while.

Ví dụ

clear browser cache

Ví dụ yêu cầu

Check whether the old page is still showing because of cache.

Runtime

Node.js

Node.js

node --version

Ý nghĩa

A JavaScript runtime used to run development tools, build scripts, and servers.

Cách dùng

Next.js dev and build commands run on Node.js.

Ví dụ

node --version

Ví dụ yêu cầu

Tell me whether this warning comes from Node.js, Next.js, or my app code.

Runtime

npm

npm

npm run build

Ý nghĩa

A package manager and script runner commonly used in JavaScript projects.

Cách dùng

package.json defines scripts such as dev, lint, and build that npm can run.

Ví dụ

npm run build

Ví dụ yêu cầu

Run the npm build script and summarize the result.

Runtime

package.json

package.json

"scripts": { "dev": "next dev -p 3001" }

Ý nghĩa

A project file that defines scripts, dependencies, and package metadata.

Cách dùng

Check package.json to know which commands the project expects you to run.

Ví dụ

"scripts": { "dev": "next dev -p 3001" }

Ví dụ yêu cầu

Check package.json before deciding which dev command to run.

Runtime

Environment variable

Environment variable

NEXT_PUBLIC_SITE_URL=https://example.com

Ý nghĩa

A value supplied to the app or build environment outside the source code.

Cách dùng

Environment variables are used for site URLs, API keys, and deployment-specific settings.

Lưu ý

Secrets should not be exposed through public client-side variables.

Ví dụ

NEXT_PUBLIC_SITE_URL=https://example.com

Ví dụ yêu cầu

Do not hard-code the production site URL if an environment variable already exists.

Lỗi và cảnh báo

404

404

404 Not Found

Ý nghĩa

An error meaning the requested page or file was not found.

Cách dùng

It can happen when a route was deleted, renamed, or not generated in static output.

Ví dụ

404 Not Found

Ví dụ yêu cầu

Check whether the old programming-basics URL now returns 404 after removal.

Lỗi và cảnh báo

500

500

500 Internal Server Error

Ý nghĩa

An error meaning the server failed while handling the request.

Cách dùng

In development, the terminal or browser overlay usually shows the source error.

Ví dụ

500 Internal Server Error

Ví dụ yêu cầu

If a 500 appears, inspect the terminal error and identify the failing file.

Lỗi và cảnh báo

Module not found

Module not found

Module not found: Can't resolve '@/lib/programming'

Ý nghĩa

An error meaning an import points to a file or package that cannot be found.

Cách dùng

It often happens after moving, deleting, or renaming files without updating imports.

Ví dụ

Module not found: Can't resolve '@/lib/programming'

Ví dụ yêu cầu

Find and update any imports that still point to the removed file.

Lỗi và cảnh báo

Export not found

Export not found

Export programmingBasicsCopy doesn't exist

Ý nghĩa

An error meaning a file exists, but the requested named export is not provided by that file.

Cách dùng

It can happen when a data object is renamed but imports still use the old name.

Ví dụ

Export programmingBasicsCopy doesn't exist

Ví dụ yêu cầu

Replace the old export name with the new one everywhere.

Lỗi và cảnh báo

EADDRINUSE

EADDRINUSE

listen EADDRINUSE: address already in use 0.0.0.0:3001

Ý nghĩa

An error meaning another process is already using the requested host and port.

Cách dùng

Use another port or stop the existing server if you intentionally want to replace it.

Ví dụ

listen EADDRINUSE: address already in use 0.0.0.0:3001

Ví dụ yêu cầu

If EADDRINUSE appears, tell me which port is busy and use a different one.

Lỗi và cảnh báo

DeprecationWarning

DeprecationWarning

[DEP0205] DeprecationWarning: module.register() is deprecated

Ý nghĩa

A warning that an API still works now but may be removed or changed later.

Cách dùng

Warnings should be noticed, but they are not always build-blocking errors.

Ví dụ

[DEP0205] DeprecationWarning: module.register() is deprecated

Ví dụ yêu cầu

Tell me whether this DeprecationWarning is harmless or requires a code change.

Lỗi và cảnh báo

Hydration

Hydration

Hydration failed because the server rendered HTML didn't match

Ý nghĩa

The process where client-side JavaScript connects to server-rendered HTML.

Cách dùng

Mismatch errors happen when server and client render different initial content.

Ví dụ

Hydration failed because the server rendered HTML didn't match

Ví dụ yêu cầu

If hydration fails, check which component renders differently on the client.

Lệnh

npm run dev

npm run dev

npm run dev

Ý nghĩa

A project script that starts the local development server.

Cách dùng

Use it while editing pages and checking changes locally.

Ví dụ

npm run dev

Ví dụ yêu cầu

Run npm run dev and give me the Local and Network URLs.

Lệnh

npm run build

npm run build

npm run build

Ý nghĩa

A project script that creates the production build or static export.

Cách dùng

Run it after changes to ensure the app can be generated successfully.

Ví dụ

npm run build

Ví dụ yêu cầu

Run npm run build and summarize any warnings or failures.

Lệnh

npm run lint

npm run lint

npm run lint

Ý nghĩa

A project script that runs lint checks.

Cách dùng

Run it before build to catch many code issues quickly.

Ví dụ

npm run lint

Ví dụ yêu cầu

Run lint before building the site.

Lệnh

curl

curl

curl -I http://localhost:3001/ko

Ý nghĩa

A command-line tool for making HTTP requests and checking responses.

Cách dùng

curl can quickly check whether a local or deployed page responds with 200, 404, or another status.

Ví dụ

curl -I http://localhost:3001/ko

Ví dụ yêu cầu

Use curl to check whether the new reference route returns 200.