Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

npm start doesn't work correctly with themes #166

Open
alexpov opened this issue Mar 9, 2019 · 5 comments
Open

npm start doesn't work correctly with themes #166

alexpov opened this issue Mar 9, 2019 · 5 comments

Comments

@alexpov
Copy link

alexpov commented Mar 9, 2019

When trying to use victor-hugo with themes, and running the npm start script as stated in the guide. Getting a site with broken CSS.

Tried to use the starta theme based on this tutorial: A Step-by-Step Guide: Victor-Hugo on Netlify and the tranquilpeak theme.

The npm run build command works well. When the site is deployed to netlify, all is good. The issue is only in the local dev environment.

When setting the baseURL from / to https://mydomain.com the issue seems to be resolved, however, all links are relative to https://mydomain.com thus each click opens the deployed version and not the localhost version

As a workaround, using hugo server -D command from the site folder

Hugo version: 0.5.4

@tomanistor
Copy link
Contributor

Same issue here. I've had luck with using npm run preview instead of npm start during local development.

@erquhart
Copy link
Contributor

If someone can dig in and get a fix together I'm happy to review and merge.

@aguywithcode
Copy link

I receive a bunch of "function hugo not defined when running npm start or npm run preview when using a theme

ERROR 2019/05/30 00:26:18 Failed to add template "404.html" in path "404.html": template: 404.html:49: function "hugo" not defined
ERROR 2019/05/30 00:26:18 Failed to add template "_default/list.html" in path "_default/list.html": template: _default/list.html:49: function "hugo" not defined
ERROR 2019/05/30 00:26:18 Failed to add template "_default/single.html" in path "_default/single.html": template: _default/single.html:49: function "hugo" not defined
ERROR 2019/05/30 00:26:18 Failed to add template "index.html" in path "index.html": template: index.html:49: function "hugo" not defined

@sugaroverflow
Copy link

sugaroverflow commented Jul 4, 2019

I'm also seeing a bunch of Failed to add template... function "hugo" not defined" as well while trying to use a theme. Same with npm run preview

using hugo server -D command from the site folder works

@aaronkwhite-sh
Copy link

Any update on this? Having the same problem using themes, it looks like webpack is somehow running the non-extended version of hugo (thus not building the themes sass), but I have extended installed via Homebrew and running hugo server/build works fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants