Picture of Jason Wilson
Plugin causing errors on publish - question
by Jason Wilson - Wednesday, 27 January 2021, 5:06 AM
 

Hi guys, me again, haha.

I've just tried adding the "Stacklist" plugin, and came up with the following errors when trying to rebuild my project from the Author Tool:

Command failed: grunt server-build:prod --outputdir=courses\6009fbc471503f2a64110344\6009fca6271ae0246060e5bb\build --theme=6009fc5471503f2a6411035f --menu=adapt-contrib-boxMenu

Fatal error: {
"message": "variable @primary-color is undefined",
"type": "Name",
"filename": "src/components/adapt-stacklist/less/stacklist.less",
"index": 178,
"line": 10,
"column": 19,
"callLine": null,
"extract": [
"\tmargin-bottom: @item-margin;",
"\tbackground-color: @primary-color;",
"\tcolor: @primary-color-inverted;"
]
}

 

I also had this same issue with another plugin I was trying (undefined Less variables), but in that case I just deleted the plugin and moved on.

If I replace those variables with regular content (eg: #fff instead of @primary-color), the plugin works.

Can somebody tell me why this might be happening? I'm presuming the plugin is trying to call the Adapt Less variables, but cannot find them? Perhaps there's been a location change as the Author Tool/Framework has ben updated?

Thanks for any help on this.

 

Picture of Jonathan Briggs
Re: Plugin causing errors on publish - question
by Jonathan Briggs - Wednesday, 27 January 2021, 8:30 AM
 

Put simply, this plugin (and lots of others) has not been maintained for the later framework versions. It's something that you can fix as you note - by changing those values, and it's not very hard since the error report tells you what's amiss - but you should consider that if you put hard values in rather than working out what the reference should be, then it will not respond to changes you might make in the Theme Picker when creating presets for different uses and can give you unexpected results along the line that become very hard to track down. There are also some instances where the updates required are more structural and hence beyond the quick fix and unless the developer responds to a request it's dead end time.

I guess it's one of the inevitable frustrations with an open-source tool that people make things and then move on to other projects or jobs and community elements get left behind. I do get that – and also completely appreciate that my own skillset is simplistic compared to that of many regular contributors on here – but unfortunately the situation gradually makes Adapt more of bind and fragmented over time when it should be the opposite. In my personal view Adapt is always going to be better the more people get into it at whatever level and I do wonder if that curve is now heading downwards in part because the major framework change has not drilled down to a number of extremely useful community plugins.

Picture of Matt Leathes
Re: Plugin causing errors on publish - question
by Matt Leathes - Wednesday, 27 January 2021, 10:38 AM
 

It looks like Chuck Lorenz has already done the heavy lifting to update this plugin for Adapt FW v5 compatibility: https://github.com/danielstorey/adapt-stacklist/pull/23

As far as I'm aware Dan Storey is still around, I think he's just been busy with project work.

When deciding whether or not to use a plugin it's always first worth checking out the Github repository to see whether it's being actively maintained or not.

You can also check for compatibility with newer versions of the Framework by looking in bower.json - if you're using the latest framework then, as a general rule, you need to be checking the 'framework' dependency is ">=5" or better

Picture of Chuck Lorenz
Re: Plugin causing errors on publish - question
by Chuck Lorenz - Wednesday, 27 January 2021, 2:35 PM
 

The vast majority of Less variables are declared in the theme. And most themes begin as modifications of adapt-contrib-vanilla.

Find most Less variables in Adapt v5 in these locations:

Vanilla experienced a significant overhaul of Less variables when framework v5 was released.

If you are working in the authoring tool and cannot manage upgrading or modifying your theme, you can assign values to problematic variables in “Custom CSS/LESS code” located in Project Settings. If you have one Less variable failing, expect that you will have a couple more reported as you assign these values.

Picture of Jason Wilson
Re: Plugin causing errors on publish - question
by Jason Wilson - Thursday, 28 January 2021, 8:43 PM
 

Thanks guys, I've managed to get this particular plugin working by using Chucks commit.

I wasnt 100% sure if there was some Less code we could drop in to these plugin/extension Less files, when having issues like this, that would relink to the current Adapt Less files.