Module build failed: TypeError: this.getOptions is not a function

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.

1 Like