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
Asynchronous writing in defineConfig will cause npm run build to fail. #16572
Comments
You are not calling const latestCommitHash = await new Promise<string>((resolve) => {
return getLastCommit((err, commit) => (err ? 'unknown' : resolve(commit.shortHash)))
}) Closing as this is not a bug in Vite. |
But locally, everything is okay, why? |
I guess it's because |
Describe the bug
Writing asynchronously in defineConfig will cause npm run build to fail when Github Action executes the job of docker/build-push-action@v5, but local packaging is completely normal.
Reproduction
https://github.com/zyronon/docker-test
Steps to reproduce
Https://github.com/zyronon/docker-test/, which is a new project just created with pnpm create vite, in which only the vite.config.ts file is modified
It is found that this method of writing is normal for local packaging, but it will fail in Github Action and do not report an error.
However, there is no problem with this writing either locally or in
Github Action
.System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: