Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite dev server unable to find vite.json file #11124

Closed
7 tasks done
aslam opened this issue Nov 29, 2022 · 1 comment
Closed
7 tasks done

Vite dev server unable to find vite.json file #11124

aslam opened this issue Nov 29, 2022 · 1 comment

Comments

@aslam
Copy link

aslam commented Nov 29, 2022

Describe the bug

I am trying to run the Vite dev server on a Windows system with Cygwin. The issue described in npm/cmd-shim#45 is not the cause since I don't have any special characters in the path.

// package.json
{
  "devDependencies": {
    "sass": "^1.56.1",
    "vite": "^3.2.3",
    "vite-plugin-ruby": "^3.1.2"
  },
  "dependencies": {
    "@ant-design/icons": "^4.8.0",
    "antd": "^5.0.0",
    "axios": "^1.1.3",
    "i18n-iso-countries": "^7.5.0",
    "localforage": "^1.10.0",
    "match-sorter": "^6.3.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.4.3",
    "sort-by": "^1.2.0"
  }
}
❯ node -v
v18.12.1

The dev server fails to start with throwing the following error:

error when starting dev server:
Error: ENOENT: no such file or directory, open '\cygdrive\c\Users\Frank\Document
s\Work\dthub\config\vite.json'
    at Object.openSync (node:fs:600:3)
    at readFileSync (node:fs:468:35)
    at loadJsonConfig (C:\Users\Frank\Documents\Work\dthub\node_modules\vite-plu
gin-ruby\dist\index.cjs:79:48)
    at loadConfiguration (C:\Users\Frank\Documents\Work\dthub\node_modules\vite-
plugin-ruby\dist\index.cjs:133:26)
    at config (C:\Users\Frank\Documents\Work\dthub\node_modules\vite-plugin-ruby
\dist\index.cjs:234:19)
    at runConfigHook (file:///C:/Users/Frank/Documents/Work/dthub/node_modules/v
ite/dist/node/chunks/dep-51c4f80a.js:62865:31)
    at resolveConfig (file:///C:/Users/Frank/Documents/Work/dthub/node_modules/v
ite/dist/node/chunks/dep-51c4f80a.js:62374:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
)
    at async createServer (file:///C:/Users/Frank/Documents/Work/dthub/node_modu
les/vite/dist/node/chunks/dep-51c4f80a.js:61636:20)
    at async CAC.<anonymous> (file:///C:/Users/Frank/Documents/Work/dthub/node_m
odules/vite/dist/node/cli.js:707:24)

Reproduction

https://stackblitz.com/edit/vitejs-vite-7xkhd7?file=.vscode%2Fsettings.json&terminal=dev

Steps to reproduce

I am sorry but not sure how to do that for Windows specific setup in stackblitz.

System Info

System:
  OS: Windows 10 10.0.19045
  CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  Memory: 1.23 GB / 15.81 GB
Binaries:
  Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
  Yarn: 1.22.19 - ~\Documents\Work\dthub\node_modules\.bin\yarn.CMD
  npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
  Edge: Spartan (44.19041.1266.0), Chromium (107.0.1418.56)
  Internet Explorer: 11.0.19041.1566

Used Package Manager

yarn

Logs

Click to expand!
$> vite build --debug
Building with Vite :zap:️
2022-11-29T18:24:50.683Z vite:config bundled config file loaded in 214.08ms
error during build:
Error: ENOENT: no such file or directory, open '\cygdrive\c\Users\Frank\Documents\Work\dthub\config\vite.json'
    at Object.openSync (node:fs:600:3)
    at readFileSync (node:fs:468:35)
    at loadJsonConfig (C:\Users\Frank\Documents\Work\dthub\node_modules\vite-plugin-ruby\dist\index.cjs:79:48)
    at loadConfiguration (C:\Users\Frank\Documents\Work\dthub\node_modules\vite-plugin-ruby\dist\index.cjs:133:26)
    at config (C:\Users\Frank\Documents\Work\dthub\node_modules\vite-plugin-ruby\dist\index.cjs:234:19)
    at runConfigHook (file:///C:/Users/Frank/Documents/Work/dthub/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62865:31)
    at resolveConfig (file:///C:/Users/Frank/Documents/Work/dthub/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:62374:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async doBuild (file:///C:/Users/Frank/Documents/Work/dthub/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:45244:20)
    at async build (file:///C:/Users/Frank/Documents/Work/dthub/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:45233:16)
pid 1152 exit 1
Build with Vite failed! x

Validations

@sapphi-red
Copy link
Member

The error is coming from vite-plugin-ruby. Please report there.

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants