template: partials/site/styles.html:4:46: executing "partials/site/styles.html" at
<toCSS>: error calling toCSS: type <nil> not supported in Resource transformations
Update 3: It appears that using mounts causes resources.ToCSS to fail. Once removed, the CSS generated fine. Now I’m back where I started with the original concat error.
I had the same problem as the OP @asagray, but was able to solve it. Thanks to @ainstushar’s pointer to the “static” mount which is necessary.
in my config.toml:
[module]
[[module.mounts]]
source = "static"
target = "static"
[[module.mounts]]
# I pick a specific js file, so only this one file gets mounted
source = "node_modules/mapbox-gl/dist/mapbox-gl.js"
target = "static/js/mapbox.js"
[[module.mounts]]
# I pick a specific css file, so only this one file gets mounted
source = "node_modules/mapbox-gl/dist/mapbox-gl.css"
target = "static/css/mapbox.css"
I get the mapbox.js file next to the bundle.js file in dist/static/js. mapbox.js is not part of bundle.js. So you have to load it separately.
But that’s just another ( potential ) challenge waiting to be conquered.
I’ve been getting the same issue and while I can get it to compile using modules, once I do it doesn’t generate any pages so I think I’ve managed to get an invalid config.toml file somehow (in updating from an old version of hugo to the latest one). I’ve setup the config.toml as suggested to import the relevant files, I added the following to the bottom of the file
error calling Concat: slice []interface {} not supported in concat
If I move the module config to the top of my config.toml, then it mounts the files correctly, copies them into the generated public folder but throws a different error on compilation
found no layout file for "HTML" for kind "taxonomy"
If I remove the modules section, and the import then it compiles successfully (There are no missing layout files)
This led me to wonder if I had a malformed config.toml file? I’ve included it at the bottom. Could I also need to update my version of go to use the mounts properly? I’m running on local and compiling using hugo -v
Any help would be gratefully appreciated! I’ll go back to manually copying and importing in the meantime.