Module build failed: TypeError: this.getOptions is not a function
at Object.loader (/Users/Dorota/Desktop/WebDev/0Client/WordPress-System/wp-content/themes/wordpress-system-demo/node_modules/postcss-loader/dist/index.js:38:24)
@ ./resources/assets/styles/main.scss 2:14-355 21:1-42:3 22:19-360
@ multi ./resources/assets/build/util/…/helpers/hmr-client.js ./scripts/main.js ./styles/main.scss
(Put the styles you posted about into resources/styles/app.scss).
npm run build
If you are wondering what nvm is, well, it is a node version manager tool (there are also others but I prefer this one): https://github.com/nvm-sh/nvm. lts/* means that the latest LTS node version branch should be used which is maintained for long times and should be very stable. npm install -g npm self-upgrades npm as with node often an outdated npm is shipped. This can also alleviate lots of issues.
Currently mac OS Mojave - 10.14.6. However, in a week I’d be using Windows.
Why do we put it in app.scss? Since app.scss doesn’t exist, so we need to change the main.scss into app.scss, does it change if we re-name the folder name?
I’m sure I’ve did what you said, but that doesn’t seem to work.
Ah, I see. I assumed that you are using Sage 10 now. Well, apparently you use Sage 9.x update branch.
If it work fine with Sage 10 you should use it. So try this again with Sage 10.
When you create a new sage project using composer (the recommended approach) you can either install 9 or 10.
For 9 without update branch you can use this command: composer create-project roots/sage your-theme-name
For 9 update branch (the GitHub repo for the update branch that hadn’t been merged yet): composer create-project roots/sage your-theme-name dev-webpack5 --repository='{"type":"vcs","url":"https://github.com/strarsis/sage"}'
For Sage 10 you use dev-master: composer create-project roots/sage your-theme-name dev-master
So I would recommend that you create a new Sage 10 project using the command above and then copy your styles over (if there are any yet) and try building it there.
Yes, I use Sage 9 and Sage 10 on WSL 2 on a regular basis, for two years or so.
I use WSL 2 Ubuntu 20.x LTS on Windows 10.
You can even install it directly as an “app” using the Microsoft Store.
Edit: Hm, one thing though: Although WSL 2 got much better compatibility with Docker and Vagrant,
WSL 1 currently got faster I/O for accessing the host disks. So when you are using WSL 2, for increased performance, you should put your files onto ~/src. I am also using a self-hosted GitLab for my code, so I can just push/clone from it anyway.