2

We have a problem in our NodeJS environment on the servers of ProfiHost (German provider) using Vite in a VueJS app.

Installing the deps via npm i works fine. However, the build via npm run build always runs with the following error:

failed to load config from /home/name/gitroot/app-name/vite.config.js

error during build:

Error: EINVAL: invalid argument, realpath '/home/name/gitroot/app-name/vite.config.js'

It seems that the error occurs on the ProfiHost server because the specified path /home/name/gitroot/app-name might not exist or be inaccessible. Of course we checked the path and couldn't find any problems.

The error is definitely NOT due to vite.config.js, since we removed it for testing. The error reappears immediately if another file is to be used.

Current config:

  • node: v18.14.2
  • nvm: 0.39.3
  • npm: 9.6.0
  • vue: 3.2.37
  • vite: 4.3.1
  • @vitejs/plugin-vue: 4.1.0

We have already tried the following:

  • path verification
  • Checking write and read permissions
  • Checking for any special characters in the path/file name
  • Shortened path tests
  • Testing with NodeJS versions 14, 16 and 18
  • Delete and re-clone the repository
  • Installing Vite on the server
  • Testing different Vite versions
  • Testing the installation on a third-party server (it worked)

What makes us suspicious now is that the build runs on the servers of another provider (Vercel) without any problems.

Other Vue apps that are also hosted by the host, but do not use Vite, all run without problems. The build works fine there. So it can be said that it is probably due to the use of Vite.

How does this error come about?

halfer
  • 19,824
  • 17
  • 99
  • 186
Tobi360
  • 188
  • 1
  • 10

1 Answers1

0

suggested use webpack vite build There are always some strange questions

王超华
  • 402
  • 3
  • 3