I’m new to Netlify but really excited about its approach and the legacy issues it addresses.
I’m trying to get the tool chain and end to end process working with challenges getting the unmodified template building locally. I trying to use the “netlify-templates/one-click-hugo-cms” template and when building from the Netlify UI all works well, the Git repo is populated and the site is built and works well.
The issues are with building the site locally on my Mac. I have installed Node (v17.3.0), NPM (8.3.0) along with Yarn (1.22.17).
When I first build and run it complains about node-sass and so using THIS post I managed to work around this.
Then it complains about Webpack. I updated package.json to use
"start:webpack": "webpack serve --config webpack.dev.js --hot", rather than the defaults which seems to work.
Also needed to run this CLI command to get it to start fully:
So now I have it running but the site is corrupt with errors related to main.css and sass-loader:
ERROR in ./src/css/main.css (./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/sass-loader/dist/cjs.js!./src/css/main.css) Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Expected identifier. ╷ 25 │ z-index: 2; │ ^
All in all this seems related to the current version of Node and NPM being newer than when the template was created. I’m happy to regress versions but not sure what version to use and not having tried to regress versions yet, I expect there to be issues.
Any advice and guidance to get the end to end workflow working would be really appreciated. The target workflow is:
- Update site content locally
- build and test locally
- commit changes to git
- publish from git via Netlify
Thanks in advance, looking forward to seeing the site finished and working on Netlify.