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

Fix AutoGen Studio pathPrefix error on Windows #3406

Conversation

New-World-2019
Copy link
Contributor

Why are these changes needed?

When I built AutoGen Studio locally in Windows environment, after executing the build command(
gatsby clean && rmdir /s /q ..\autogenstudio\web\ui 2>nul & (set "PREFIX_PATH_VALUE=" || ver>nul) && gatsby build --prefix-paths && xcopy /E /I /Y public ..\autogenstudio\web\ui
), the frontend could not find the page after clicking. After analysis, I found that this was because when the Windows environment variable was set to empty, the process.env.PREFIX_PATH_VALUE value read by the code was undefined, which caused the path problem. So I modified the gatsby-config.ts code and tested it under Windows and Linux without problems.

The change mainly adds an OR operation.When the value of process.env.PREFIX_PATH_VALUE is undefined in Windows, the pathPrefix value is empty. The change can solve the problem that the frontend page cannot be displayed when PREFIX_PATH_VALUE is set to empty in Windows.

Related issue number

Closes #3109

Checks

@gagb gagb requested a review from victordibia August 23, 2024 18:50
@gagb gagb added the proj-studio Related to AutoGen Studio. label Aug 23, 2024
@victordibia victordibia added this pull request to the merge queue Aug 28, 2024
Merged via the queue into microsoft:main with commit 2e77d3b Aug 28, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proj-studio Related to AutoGen Studio.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: For Windows users, to build the frontend, you may need alternative commands to build the frontend.
3 participants