Skip to content

Commit

Permalink
docs(nextjs): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
andys8 committed Nov 7, 2024
1 parent 0d746ef commit ac2b064
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/generated/packages/next/executors/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
},
"required": ["buildTarget"],
"examplesFile": "---\ntitle: Next.js server executor examples\ndescription: This page contains examples for the @nx/next:serve executor.\n---\n\n`project.json`:\n\n```json\n//...\n{\n \"name\": \"acme\",\n \"$schema\": \"node_modules/nx/schemas/project-schema.json\",\n \"sourceRoot\": \".\",\n \"projectType\": \"application\",\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n }\n }\n //...\n }\n}\n```\n\n```bash\nnx run acme:serve\n```\n\n## Examples\n\n### For Next.js Standalone projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Next.js standalone projects. Our `@nx/next:server` executor is integrated to use Next.js' CLI. You can read more about the serve options at [Next.js CLI Options](https://nextjs.org/docs/app/api-reference/next-cli)\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true\n },\n \"production\": {\n \"buildTarget\": \"acme:build:production\",\n \"dev\": false\n }\n }\n },\n```\n\n{% /tab %}\n{% tab label=\"Enable turbo\" %}\n\nTurbopack (beta) is a cutting-edge bundler designed for JavaScript and TypeScript. To read more about support features see [Next.js Turbopack Doucmentation](https://turbo.build/pack/docs/features)\n\nIn the context of Nx, you can utilize Turbopack within both the `pages` and `app` directories of Next.js to enhance local development speed. To activate Turbopack, simply:\n\nAppend the `--turbo` flag while executing the Nx development server.\n\n```shell\nnx run acme:serve --turbo\n```\n\nUpdating the build options to include `turbo`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"turbo\": true\n },\n //\n }\n }\n```\n\n```bash\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% tab label=\"Adding keep alive timeout\" %}\n\nWhen using Nx with Next.js behind a downstream proxy, it's important to make sure that the `keep-alive timeouts` of Next.js' HTTP server are set to longer durations than the timeouts of the proxy. If you don't do this, Node.js will unexpectedly end TCP connections without notifying the proxy when the `keep-alive timeout` is reached. This can lead to a proxy error when the proxy tries to reuse a connection that Node.js has already terminated.\n\nTo configure timeout values (in milliseconds) you can:\n\nPass `--keepAliveTimeout`\n\n```shell\nnx run acme:serve --keepAliveTimeout 60000\n```\n\nUpdating the serve options to include `keepAliveTimeout`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"keepAliveTimeout\": 60000\n },\n //\n }\n }\n```\n\n```shell\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
"examplesFile": "---\ntitle: Next.js server executor examples\ndescription: This page contains examples for the @nx/next:serve executor.\n---\n\n`project.json`:\n\n```json\n//...\n{\n \"name\": \"acme\",\n \"$schema\": \"node_modules/nx/schemas/project-schema.json\",\n \"sourceRoot\": \".\",\n \"projectType\": \"application\",\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n }\n }\n //...\n }\n}\n```\n\n```bash\nnx run acme:serve\n```\n\n## Examples\n\n### For Next.js Standalone projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Next.js standalone projects. Our `@nx/next:server` executor is integrated to use Next.js' CLI. You can read more about the serve options at [Next.js CLI Options](https://nextjs.org/docs/app/api-reference/next-cli)\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true\n },\n \"production\": {\n \"buildTarget\": \"acme:build:production\",\n \"dev\": false\n }\n }\n },\n```\n\n{% /tab %}\n{% tab label=\"Enable turbo\" %}\n\nTurbopack (beta) is a cutting-edge bundler designed for JavaScript and TypeScript. To read more about support features see [Next.js Turbopack Documentation](https://turbo.build/pack/docs/features)\n\nIn the context of Nx, you can utilize Turbopack within both the `pages` and `app` directories of Next.js to enhance local development speed. To activate Turbopack, simply:\n\nAppend the `--turbo` flag while executing the Nx development server.\n\n```shell\nnx run acme:serve --turbo\n```\n\nUpdating the build options to include `turbo`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"turbo\": true\n },\n //\n }\n }\n```\n\n```bash\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% tab label=\"Adding keep alive timeout\" %}\n\nWhen using Nx with Next.js behind a downstream proxy, it's important to make sure that the `keep-alive timeouts` of Next.js' HTTP server are set to longer durations than the timeouts of the proxy. If you don't do this, Node.js will unexpectedly end TCP connections without notifying the proxy when the `keep-alive timeout` is reached. This can lead to a proxy error when the proxy tries to reuse a connection that Node.js has already terminated.\n\nTo configure timeout values (in milliseconds) you can:\n\nPass `--keepAliveTimeout`\n\n```shell\nnx run acme:serve --keepAliveTimeout 60000\n```\n\nUpdating the serve options to include `keepAliveTimeout`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"keepAliveTimeout\": 60000\n },\n //\n }\n }\n```\n\n```shell\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
"presets": []
},
"description": "Serve a Next.js application.",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/docs/server-next-executor-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ This is the default configuration for Next.js standalone projects. Our `@nx/next
{% /tab %}
{% tab label="Enable turbo" %}

Turbopack (beta) is a cutting-edge bundler designed for JavaScript and TypeScript. To read more about support features see [Next.js Turbopack Doucmentation](https://turbo.build/pack/docs/features)
Turbopack (beta) is a cutting-edge bundler designed for JavaScript and TypeScript. To read more about support features see [Next.js Turbopack Documentation](https://turbo.build/pack/docs/features)

In the context of Nx, you can utilize Turbopack within both the `pages` and `app` directories of Next.js to enhance local development speed. To activate Turbopack, simply:

Expand Down

0 comments on commit ac2b064

Please sign in to comment.