nuxt / cli

⚡️ Nuxt Generation CLI Experience.
https://github.com/nuxt/cli/discussions/3
MIT License
260 stars 64 forks source link

Strange issues with nitro/hanging forever? #245

Closed ckcollab closed 1 year ago

ckcollab commented 1 year ago

Currently I get this semi-randomly, when running npx nuxi dev:

Error: ENOENT: no such file or directory, access '/tmp/nitro/worker-70-1.sock' | Nuxt

This will persist even after computer restarts, within docker, outside docker.. so strange!

Here's my package.json:

{
    "private": true,
    "engines": {
        "node": "18.x",
        "npm": "9.x || 10.x"
    },
    "scripts": {
        "build": "nuxt build",
        "dev": "nuxt dev",
        "generate": "nuxt generate",
        "reset": "rm -rf .nuxt node_modules .output package-lock.json && npm install",
        "test": "cypress install && xvfb-run -a npx cypress run",
        "preview": "nuxt preview",
        "postinstall": "nuxt prepare",
        "heroku-postbuild": "cd src/frontend && nuxi generate"
    },
    "devDependencies": {
        "@iconify/vue": "^4.1.1",
        "@nuxtjs/google-fonts": "^3.0.2",
        "@vueuse/core": "^10.5.0",
        "@vueuse/nuxt": "^10.5.0",
        "cypress": "^13.3.0",
        "nuxt": "^3.7.4",
        "sass": "^1.69.1",
        "stylus": "^0.60.0",
        "stylus-loader": "^7.1.3",
        "vuetify": "^3.3.20",
        "vuetify-nuxt-module": "^0.5.14"
    },
    "dependencies": {
        "@pinia/nuxt": "^0.4.11",
        "pinia": "^2.1.6"
    },
    "overrides": {
        "vue": "latest"
    }
}

What's funny is I can generate and serve the site just fine, like so:

$ npx nuxi generate && npx serve .output/public

I've tried getting deeper logs from Nitro by adding this to nuxt.config.ts, but it seems to have no effect:

export default defineNuxtConfig({
  logLevel: 'verbose',

  // Nitro server config
  nitro: {
    logLevel: 5
  },
})

Since I'm not seeing a lot of threads about this, but myself and another engineer are constantly getting it, we must be doing something simple/silly wrong?

Appreciate any help, and thanks for Nuxt!

ckcollab commented 1 year ago

For anyone else googling who experiences this, it seemed to be from a middleware redirecting to a page, that has a middleware that redirects to the first page, and so on until things crash..!