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

Error on Vite Build - You stumbled upon a bug in Vike's source code #1440

Closed
emarineli-mb opened this issue Jan 15, 2024 · 3 comments
Closed
Labels

Comments

@emarineli-mb
Copy link

Description

Error: [[email protected]][Bug] You stumbled upon a bug in Vike's source code.

Node Versions:
Node: 21.5.0
npm: 10.2.4

Versions:
"vite": "^4.3.5",
"vike": "^0.4.142",
Stacktrace:

at runCmd (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js:142:5)
at async Promise.all (index 1)
at gitLsFiles (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js:73:33)
at crawlPlusFiles (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js:23:17)
at findPlusFiles (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:798:19)
at loadInterfaceFiles (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:73:23)
at loadVikeConfig (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:233:40)
at loadVikeConfig_withErrorHandling (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:196:15)
at getVikeConfig (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js:70:12)
at getConfigVikPromise (file:///tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/config/index.js:27:54)

@brillout
Copy link
Member

Add the following before line 142 of /tmp/build/node_modules/vike/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/crawlPlusFiles.js and report back the result.

async function runCmd(cmd, cwd) {
    const res = await execA(cmd, { cwd });
+   console.log('res.stderr', res.stderr);
    assert(res.stderr === '');

@emarineli-mb
Copy link
Author

I found the issue! It's because a env var GIT_TRACE_SETUP=true so when vite build calls git command "ls-files" it comes with trace data together.

tks

@brillout
Copy link
Member

Indeed, I could reproduce. Fix pre-released in 0.4.156-commit-e46716d.

Btw. would your company be up for sponsoring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants