-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Hugo attempts to download module from GitHub even after it has been downloaded to _vendors folder #12555
Comments
Do you have a simple example that shows the behaviour you describe? |
I am unable to reproduce the problem as described.
Terminate all network connections, then...
You should see 3 articles listed on the home page. |
The current logic is rather simple (taken from memory): If the main project has a |
To reproduce:
This results in the following error and inability to view the site even though the module is vendored:
This can be a common use case where you have a developer creating a modular Hugo project for a business stakeholder or client, but only the developer should have access to the private Hugo module in the repo, so the module is vendored for the stakeholder/client. |
@gcushen that's not a "simple example". |
It's a fully reproducible example of importing an arbitrary private Hugo module in only 8 steps, based on the minimally reproducible |
OK, maybe "not simple" wasn't the correct way to describe your example. But manually constructing the Go module/vendoring setup (example line below) is not the real thing and filled with many sources of error.
That said, I tested your example, and it runs fine on my MacBook. I also tried to delete the Can you
Also, is this something only you experience or is this something that's reported from your end users? |
If you're able to insert some debug prints in Hugo code, you can check if this condition triggers or not (and possibly also why): Line 194 in c8dac67
|
Currently, Hugo can attempt to download a module from GitHub even if it has been downloaded to the
_vendors
folder.The expected behavior is that Hugo checks if the module in
go.mod
has been downloaded to the_vendors
folder before attempting to access the internet.This can be a common use case where you have a developer creating a modular Hugo project for a business stakeholder or client, but only the developer should have access to the private Hugo module in the repo, so the module is vendored for the stakeholder/client.
As a workaround, if the private Hugo module is deleted from
go.mod
then Hugo will use the vendored module. Ideally, it should not require the workaround of the stakeholder/client deleting the module fromgo.mod
as then theirgo.mod
is out of sync with the developer's copy.What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
The text was updated successfully, but these errors were encountered: