Skip to content

docs(nuxt): use host '0' instead of env variable for dev server #3351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/content/docs/start/frontend/nuxt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ tableOfContents:

import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';

Nuxt is a meta framework for Vue. Learn more about Nuxt at https://nuxt.com. This guide is accurate as of Nuxt 3.11.
Nuxt is a meta framework for Vue. Learn more about Nuxt at https://nuxt.com. This guide is accurate as of Nuxt 3.17.

## Checklist

- Use SSG by setting `ssr: false`. Tauri doesn't support server based solutions.
- Use `process.env.TAURI_DEV_HOST` as the development server host IP when set to run on iOS physical devices.
- Use `dist/` as `frontendDist` in `tauri.conf.json`.
- Compile using `nuxi generate`.
- Use default `../dist` as `frontendDist` in `tauri.conf.json`.
- Compile using `nuxi build`.
- (Optional): Disable telemetry by setting `telemetry: false` in `nuxt.config.ts`.

## Example Configuration
Expand All @@ -33,7 +32,7 @@ Nuxt is a meta framework for Vue. Learn more about Nuxt at https://nuxt.com. Thi
{
"build": {
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run generate",
"beforeBuildCommand": "npm run build",
"devUrl": "http://localhost:3000",
"frontendDist": "../dist"
}
Expand All @@ -48,7 +47,7 @@ Nuxt is a meta framework for Vue. Learn more about Nuxt at https://nuxt.com. Thi
{
"build": {
"beforeDevCommand": "yarn dev",
"beforeBuildCommand": "yarn generate",
"beforeBuildCommand": "yarn build",
"devUrl": "http://localhost:3000",
"frontendDist": "../dist"
}
Expand All @@ -63,7 +62,7 @@ Nuxt is a meta framework for Vue. Learn more about Nuxt at https://nuxt.com. Thi
{
"build": {
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm generate",
"beforeBuildCommand": "pnpm build",
"devUrl": "http://localhost:3000",
"frontendDist": "../dist"
}
Expand Down Expand Up @@ -93,12 +92,15 @@ Nuxt is a meta framework for Vue. Learn more about Nuxt at https://nuxt.com. Thi

```ts
export default defineNuxtConfig({
compatibilityDate: '2025-05-15',
// (optional) Enable the Nuxt devtools
devtools: { enabled: true },
// Enable SSG
ssr: false,
// Enables the development server to be discoverable by other devices when running on iOS physical devices
devServer: { host: process.env.TAURI_DEV_HOST || 'localhost' },
devServer: {
host: '0'
},
vite: {
// Better support for Tauri CLI output
clearScreen: false,
Expand All @@ -111,6 +113,10 @@ Nuxt is a meta framework for Vue. Learn more about Nuxt at https://nuxt.com. Thi
strictPort: true,
},
},
// Avoids error [unhandledRejection] EMFILE: too many open files, watch
ignore: [
'**/src-tauri/**'
],
});
```

Expand Down
Loading