gabrieljackson / mattermost-plugin-wrangler

Manage Mattermost Messages Masterfully!
Apache License 2.0
49 stars 13 forks source link

Build fails with invalid sass loader options #145

Closed grubbins closed 9 months ago

grubbins commented 1 year ago

With node 14 on OSX, make dist eventually failed with:

ERROR in ./src/components/left_sidebar_element/style.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./src/components/left_sidebar_element/style.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'includePaths'. These properties are valid:
   object { implementation?, sassOptions?, additionalData?, sourceMap?, webpackImporter?, warnRuleAsWarning? }
    at validate (/Users/dgittins/code/github/mattermost-plugin-wrangler.git/webapp/node_modules/schema-utils/dist/validate.js:105:11)
    at Object.getOptions (/Users/dgittins/code/github/mattermost-plugin-wrangler.git/webapp/node_modules/webpack/lib/NormalModule.js:527:19)
    at Object.loader (/Users/dgittins/code/github/mattermost-plugin-wrangler.git/webapp/node_modules/sass-loader/dist/index.js:25:24)

I was able to make the build complete with this patch:

diff --git a/webapp/webpack.config.js b/webapp/webpack.config.js
index 0fd7126..042899d 100644
--- a/webapp/webpack.config.js
+++ b/webapp/webpack.config.js
@@ -38,7 +38,9 @@ module.exports = {
                     {
                         loader: 'sass-loader',
                         options: {
-                            includePaths: ['node_modules/compass-mixins/lib', 'sass'],
+                            sassOptions: {
+                                includePaths: ['node_modules/compass-mixins/lib', 'sass'],
+                            },
                         },
                     },
                 ],

Is that the correct fix...?

gabrieljackson commented 9 months ago

Sorry about the delay on this, but the webapp build issues should now be resolved with https://github.com/gabrieljackson/mattermost-plugin-wrangler/pull/154

Let me know if you are still having any issues.