1

I'm using Vite v4.1.1 with Vue 3.2 and all of a sudden got the following error message while running npm run dev:

[ERROR] No loader is configured for ".node" files: node_modules/fsevents/fsevents.node

    node_modules/fsevents/fsevents.js:13:23:
      13 │ const Native = require("./fsevents.node");
         ╵                        ~~~~~~~~~~~~~~~~~

More error details:

Error: Build failed with 1 error:
errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 23,
        file: 'node_modules/fsevents/fsevents.js',
        length: 17,
        line: 13,
        lineText: 'const Native = require("./fsevents.node");',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'No loader is configured for ".node" files: node_modules/fsevents/fsevents.node'
    }
  ],
  warnings: []
}

Node.js v19.6.0

I tried the fix suggested here with no luck, it just introduces more errors with even less explanation.

dawesydev
  • 11
  • 2

2 Answers2

2

This might not be relevant to everyone, but I just had this exact error pop up in a Svelte app, and the cause turned out to be an erroneous import.

I had:

import { defineConfig } from "vite";

which I my IDE had accidentally auto imported. Removing the import fixed the issue.

2

Resolved this error by just removing -

"import { resolveBaseUrl } from 'vite';"

which was imported by itself or maybe accidentally while importing something!