kit: Error: No loader is configured for ".node" files: node_modules/fsevents/fsevents.node

Describe the bug

just updated to latest svelte version, I am seeing this error occasionally. it is not happening consistently 😦

✘ [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");
     ╵                        ~~~~~~~~~~~~~~~~~

6:36:27 PM [vite-plugin-svelte] prebundle libraries done. package files time avg svelte-starter-kit 482 2.74s 5.7ms 6:36:27 PM [vite] error while updating dependencies: Error: Build failed with 1 error: node_modules/fsevents/fsevents.js:13:23: ERROR: No loader is configured for “.node” files: node_modules/fsevents/fsevents.node at failureErrorWithLog (/Users/schinth/Developer/Work/SPA/svelte-starter-kit/node_modules/esbuild/lib/main.js:1591:15) at /Users/schinth/Developer/Work/SPA/svelte-starter-kit/node_modules/esbuild/lib/main.js:1047:28 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) hooks.server.ts, HandleFetch: errors null

image

Reproduction

Repo: https://github.com/xmlking/svelte-starter-kit.git

Logs

package                 files    time     avg
svelte-starter-kit        536   0.92s   1.7ms
6:36:23 PM [vite-plugin-svelte] prebundle libraries in progress ...
6:36:27 PM [vite-plugin-svelte] /src/lib/blocks/dashboard/Header1.svelte:20:3 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.
6:36:27 PM [vite-plugin-svelte] /src/lib/blocks/dashboard/Header1.svelte:30:3 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.
6:36:27 PM [vite-plugin-svelte] /src/lib/components/PreloadingIndicator.svelte:52:1 Unused CSS selector ":global(html).dark .fade"
✘ [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");
         ╵                        ~~~~~~~~~~~~~~~~~

6:36:27 PM [vite-plugin-svelte] prebundle libraries done.
package                 files    time     avg
svelte-starter-kit        482   2.74s   5.7ms
6:36:27 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/fsevents/fsevents.js:13:23: ERROR: No loader is configured for ".node" files: node_modules/fsevents/fsevents.node
    at failureErrorWithLog (/Users/schinth/Developer/Work/SPA/svelte-starter-kit/node_modules/esbuild/lib/main.js:1591:15)
    at /Users/schinth/Developer/Work/SPA/svelte-starter-kit/node_modules/esbuild/lib/main.js:1047:28
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
hooks.server.ts, HandleFetch:

System Info

npx envinfo --system --binaries --browsers --npmPackages "{svelte,@sveltejs/*,vite}"                                                                                ☸ elrprdusr001_cs-sre_cs-sre-hcc-naas-admin (cs-sre) 
Need to install the following packages:
  envinfo@7.8.1
Ok to proceed? (y) 

  System:
    OS: macOS 12.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.63 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.9.0 - ~/homebrew/bin/node
    npm: 8.19.1 - ~/homebrew/bin/npm
  Browsers:
    Chrome: 108.0.5359.98
    Safari: 16.1
  npmPackages:
    @sveltejs/adapter-auto: 1.0.0-next.90 => 1.0.0-next.90 
    @sveltejs/adapter-node: 1.0.0-next.104 => 1.0.0-next.104 
    @sveltejs/adapter-static: 1.0.0-next.49 => 1.0.0-next.49 
    @sveltejs/kit: 1.0.0-next.587 => 1.0.0-next.587 
    svelte: 3.55.0 => 3.55.0 
    vite: 4.0.1 => 4.0.1

Severity

annoyance

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 23 (2 by maintainers)

Most upvoted comments

Same here, happened all of a sudden and can’t seem to get rid of it. (tried to remove node_modules and .svelte-kit)

EDIT: seems like VisualCode had auto imported import { loadConfigFromFile } from 'vite' for me and when I removed that the error dissapeared

the only way for me was transpilation of fsevents with nuxt, ts in nuxt.config.ts:

export default { build: { transpile: [‘fsevents’] } }

Based on this stack overflow: https://stackoverflow.com/questions/46929196/how-to-solve-npm-install-throwing-fsevents-warning-on-non-mac-os

I deleted node_modules, and then did a npm install --no-optional and it made the issue go away (just deleting and doing npm install had no effect)

Same here, happened all of a sudden and can’t seem to get rid of it. (tried to remove node_modules and .svelte-kit)

EDIT: seems like VisualCode had auto imported import { loadConfigFromFile } from 'vite' for me and when I removed that the error dissapeared

I had the exact same issue!

Same here, happened all of a sudden and can’t seem to get rid of it. (tried to remove node_modules and .svelte-kit)

EDIT: seems like VisualCode had auto imported import { loadConfigFromFile } from 'vite' for me and when I removed that the error dissapeared

thank you! I wasted ages on this and found a VS Code auto import import {sortUserPlugins} from 'vite'; for no reason other than to spoil my afternoon.