Home  >  Q&A  >  body text

VueJS: Unable to load configuration from \Project\vuejs-frontend\vite.config.js

My project was running fine yesterday, but after revisiting the project today, I encountered this error when trying to run the project.

This is my vite.config.js file:

import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
});

This is the error I receive:

failed to load config from C:UsersDesktopLearnProjectvuejs-frontendvite.config.js
error when starting dev server:
Error: The service was stopped
    at C:UsersDesktopLearnProjectvuejs-frontendnode_modulesesbuildlibmain.js:1337:25
    at C:UsersDesktopLearnProjectvuejs-frontendnode_modulesesbuildlibmain.js:666:9
    at Socket.afterClose (C:UsersDesktopLearnProjectvuejs-frontendnode_modulesesbuildlibmain.js:644:7)
    at Socket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Please share with me any helpful tips you know. Thanks

P粉436410586P粉436410586362 days ago702

reply all(1)I'll reply

  • P粉595605759

    P粉5956057592023-10-23 00:49:48

    Please check your node version, in my case I updated my node version {node: 'v14.17.6'} as shown below and everything went well.

    --- log --- Package: 'vite@3.0.2', Required: { node: '^14.18.0 || >=16.0.0' }, Current: {node: 'v14.17.6', npm: '8.15.0'}

    Hope it helps you

    reply
    0
  • Cancelreply