node.jstypescriptnuxt.jstailwind-cssvite

Nuxt 4 + tailwindcss + directus gettng error "500 Cannot redefine property: _path"


So I'm trying to do a project in Nuxt 4, and I got a problem when I try to edit any CSS element. It just crashes to 500 Cannot redefine property: _path I tried changing node version because I found one user changed his version from node 20 to 24, and it fixed it, but I tried the same and still nothing

error 500:

Cannot redefine property: _path
    at <project-root>/.nuxt/middleware.mjs:12:10
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async ViteNodeRunner.runModule (<project-root>/node_modules/vite-node/dist/client.mjs:397:4)
    at async ViteNodeRunner.directRequest (<project-root>/node_modules/vite-node/dist/client.mjs:375:3)
    at async ViteNodeRunner.cachedRequest (<project-root>/node_modules/vite-node/dist/client.mjs:189:11)
    at async ViteNodeRunner.dependencyRequest (<project-root>/node_modules/vite-node/dist/client.mjs:239:10)
    at async <project-root>/node_modules/nuxt/dist/pages/runtime/plugins/router.js:14:32
    at async ViteNodeRunner.runModule (<project-root>/node_modules/vite-node/dist/client.mjs:397:4)
    at async ViteNodeRunner.directRequest (<project-root>/node_modules/vite-node/dist/client.mjs:375:3)

nuxt.config.ts:

export default defineNuxtConfig({
  compatibilityDate: '2025-10-02',
  srcDir: 'app/',
  
  future: {
    compatibilityVersion: 4,
  },
  
  app: {
    head: {
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
      ]
    }
  },
  
  modules: [
    '@nuxtjs/tailwindcss',  
    ['@nuxtjs/google-fonts', {
      families: {
        Mulish: [300, 400, 500, 600, 700, 800, 900]
      },
      display: 'swap',
      preload: true,
      prefetch: false,
      preconnect: true,
      download: true,
      base64: false
    }]
  ],
  
  runtimeConfig: {
    public: {
      directusUrl: 'http://localhost:8055'
    }
  }
})

Solution

  • You're right. It is (was) a Nuxt bug. It should be solved in version 4.1.3 (in the best case). Here is the PR on Github.