-
Notifications
You must be signed in to change notification settings - Fork 36
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
Azure Pipelines Build Error #138
Comments
Hi, are you validating the environment before run |
Ahh. I was thinking you were running the Vite dev server but it's not that. |
Don't I need that for development? If so is it possible to pass through the environment variable and skip making the cert? |
The certificate is only required if you want/need to use And as you said, you can also use environment variables to skip the cert in your |
This worked great! Do you think it would be good to update the example to have this logic already? Could be useful. // Ensure the certificate and key exist
if (process.env.ASPNETCORE_ENVIRONMENT === 'Development' && (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath))) {
// Make the cert folder if missing
if (!fs.existsSync(baseFolder))
fs.mkdirSync(baseFolder); Not sure if there is a downside, but I changed the cert path to: const baseFolder =
`${process.env.PWD}/.certs`; This helps get around permission issues when making the directory if it doesn't exist (something that has to be manually fixed when running the original example on OSX) |
Describe the bug
When running Azure Pipelines and building in Release mode, I get the following error:
There was an error exporting the HTTPS developer certificate to a file. Please create the target directory before exporting. Choose permissions carefully when creating it.
To Reproduce
Set up a build pipeline with a project using Vite.AspNetCore. In this case I used the example MVC project.
Expected behavior
For the built to complete. Since I am targeting
Release
, it shouldn't even be asking for a HTTPS developer certificate.Screenshots
![image](https://private-user-images.githubusercontent.com/2667344/392541139-78432f59-fae6-4de5-897c-176f00e35693.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjI3MDQsIm5iZiI6MTczOTU2MjQwNCwicGF0aCI6Ii8yNjY3MzQ0LzM5MjU0MTEzOS03ODQzMmY1OS1mYWU2LTRkZTUtODk3Yy0xNzZmMDBlMzU2OTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMTk0NjQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjNhMjYyZmIzNzRiOWFmMGNmMmI5OGMxYWVhODc2NTE2MWZkNzllN2U1YWM1MjQ5NTIwYTdmODMyMDczYmZkMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.A6sJE7lnlfjwNiNZzrMHNc34RMf9IMEg9Tjo9T_vfkU)
Device (please complete the following information):
Additional context
This is my build task in Cake:
The text was updated successfully, but these errors were encountered: