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

Build fails with changed mount behavior assets directory #12175

Closed
h-enk opened this issue Feb 29, 2024 · 5 comments · Fixed by #12187
Closed

Build fails with changed mount behavior assets directory #12175

h-enk opened this issue Feb 29, 2024 · 5 comments · Fixed by #12187

Comments

@h-enk
Copy link

h-enk commented Feb 29, 2024

Module mounts behavior of the assets directory changed with Hugo v0.123.0 and later.

Known inpact: all Doks and Hyas users.

Replicate

Clone repository

git clone https://github.com/h-enk/hyas-hugo-v0.123.6.git

Install dependencies

npm install

Run development server

npm run dev

Module mounts (default settings)

config/_default/module.toml

## assets
[[mounts]]
  source = "node_modules/@hyas/core/assets"
  target = "assets"

[[mounts]]
  source = "assets"
  target = "assets"

Result: NOK

execute of template failed: template: partials/head/libsass.html:9:36: executing "partials/head/libsass.html" at <$css.Permalink>: error calling Permalink: operation not supported on directory ""

Module mounts (temporary fix)

config/_default/module.toml

## assets
[[mounts]]
  source = "node_modules/@hyas/core/assets"
  target = "assets"
  excludeFiles = ["scss/app.scss"]

[[mounts]]
  source = "assets"
  target = "assets"

Result: OK

Resources

@jmooring
Copy link
Member

jmooring commented Mar 1, 2024

@h-enk

Here's what I did on a virgin Debian system with node v20.11.1:

git clone https://github.com/h-enk/hyas-hugo-v0.123.6.git
cd hyas-hugo-v0.123.6/
npm install

Here's what I got:

npm notice 
npm notice New minor version of npm available! 10.2.4 -> 10.5.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.5.0
npm notice Run npm install -g npm@10.5.0 to update!
npm notice 
npm ERR! code 1
npm ERR! path /home/jmooring/temp/hyas-hugo-v0.123.6/node_modules/gethyas
npm ERR! command failed
npm ERR! command sh -c hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo

npm ERR! A complete log of this run can be found in: /home/jmooring/.npm/_logs/2024-03-01T00_57_30_589Z-debug-0.log

I tested on a virgin Debian system because I couldn't get it to work on my Ubuntu system either.

@h-enk
Copy link
Author

h-enk commented Mar 1, 2024

Here's a repository that doesn't (try to) install Hugo locally:

@ytrepidorosonomous
Copy link

Can confirm the issue on Windows

$ hugo env
hugo v0.123.6-92684f9a26838a46d1a81e3c250fef5207bcb735+extended windows/amd64 BuildDate=2024-02-28T18:29:40Z VendorInfo=gohugoio
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.22.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"

@bep bep self-assigned this Mar 1, 2024
@bep bep removed the NeedsTriage label Mar 1, 2024
@bep bep added this to the v0.123.7 milestone Mar 1, 2024
@bep
Copy link
Member

bep commented Mar 1, 2024

I will have a look at this and see if there is an easy fix, but I have said it before and I will say it again: The overlay file system is built horizontally (project -> module1 -> module2); the file mounts were never meant to have advanced vertical merge semantics, so you should try to avoid that (which I suspect should be fairly simple in the above case).

@h-enk could you edit the issue title to be more specific and, if possible, with a less negative tone.

bep added a commit to bep/hugo that referenced this issue Mar 1, 2024
bep added a commit to bep/hugo that referenced this issue Mar 1, 2024
bep added a commit to bep/hugo that referenced this issue Mar 1, 2024
@bep bep closed this as completed in #12187 Mar 1, 2024
bep added a commit that referenced this issue Mar 1, 2024
@h-enk h-enk changed the title Hugo v0.123.6 breaks build Build fails with changed mount behavior assets directory Mar 1, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants