Developer forum

Forum » CMS - Standard features » Cannot copy website when Designs folder contains problematic less files even when no Rapido is used

Cannot copy website when Designs folder contains problematic less files even when no Rapido is used

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

Please see the following: https://www.screencast.com/t/pgGFstvMB

In this video, you can see I get an error when copying a web site that has custom less files. The error shows up in the log file which was very helpful. From DW's perspective the config file can indeed not be found (it's in the parent folder of the files that use it) but it's working fine with our own compilation process. Why is Dynamicweb trying to compile my CSS when I copy a site? I suspect it's the same issue as this one: http://doc.dynamicweb.com/forum/cms-standard-features/cms-standard-features/rapido-code-interfering-with-our-own-css-and-less as I assume the new area gets saved when copied. 

Can we prevent this from happening? Either don't crash on invalid less files or by opting out of the Rapdio stuff? The trick with the XML file doesn't seem to work here as the site or file doesn't exist when it gets copied.

Thanks!

Imar


Replies

 
Merethe Vrå Andersen Dynamicweb Employee
Merethe Vrå Andersen
Reply

Hi Imar,

I can't reproduce this with the latest Rapido from12/12-2017: https://www.screencast.com/t/jMfe9V5sylk
Did did you merge rapido files with your own solution?

Kind regards,
Merethe

 

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Nope, I don't have any Rapido files; just my own, and that's where the issue is. This is not related to the Rapido file set at all. The issue is that my files under Designs\DesignName\Css are compiled by Dynamicweb when I save an area (for Rapido support) which then breaks.

I can send you a copy of my Designs solder so you can see for yourself?

So to summarize: it's my code that fails to compile. However, it's Dynamicweb trying to compile my files where it shouldn't.

Imar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Note: this is also happening when saving changes for an area as it seems the same less compilation process takes place then as well.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Found a simple way to reproduce (at least on my end).

1. In an existing site, create a new design folder using the attached ZIP archive. Notice that it has a CSS folder with a single less file with this content:

@import url(DoesNotExist.less);

2. Create a new site / area and assing this design. 

3. Save all changes.

4. Try copying the site in the Websites module. It will fail and you'll find an error log under /System/Log/AreaService/Errors/Area_NN saying something like this:

2017-12-18 21:52:26.3163|ERROR|AreaService/Errors/Area_11|Error happened while executing operation! Area was not copied!
System.IO.FileNotFoundException: You are importing a file ending in .less that cannot be found [DoesNotExist.less].
File name: 'DoesNotExist.less'
   at dotless.Core.Importers.Importer.Import(Import import)
   at dotless.Core.Parser.Tree.Import.GetImportAction(IImporter importer)
   at dotless.Core.Parser.Tree.Import.Evaluate(Env env)

 

The issue is casued by my own .less file which, from DW's view is invalid because DoesNotExist does not exist. However, with our compiler it is valid eventually, so all I want is to have DW back off when saving an area and not trying to compile my .less. A checkbox like "Don't compile less" (or better "Compile less" so it's opt-in) would be great.

Hope this helps reproducing it.

 

 
Nicolai Pedersen
Reply

Send this to development for reproduction.

Thanks, Nicolai

 

You must be logged in to post in the forum