Squarespace / less-compiler

Less compiler in Java
Apache License 2.0
19 stars 9 forks source link

Local development broken #7

Closed JoshuaWise closed 4 years ago

JoshuaWise commented 5 years ago

Hello, I'm an experienced full stack web developer (6 years experience), and I was just hired to develop a custom landing page on an existing Squarespace website. I only have experience coding websites from scratch, so this is my first time using a platform like Squarespace.

I followed the beginner tutorial step-by-step, and then I started a local server by running:

squarespace-server --auth --auto-reload <website URL>

After authenticating myself, the website appeared at localhost:9000, but the styles were missing. In my terminal, I noticed that GET /local-assets/site.css was giving a 500 error, so I went to that address and found this error message:

LESS Compiler said:

 _______  _______  _______  _______  __
|       ||       ||       ||       ||  |
|   _   ||   _   ||    _  ||  _____||  | 
|  | |  ||  | |  ||   |_| || |_____ |  |
|  |_|  ||  |_|  ||    ___||_____  ||__|
|       ||       ||   |     _____| | __
|_______||_______||___|    |_______||__| 

Line  Statement
---------------
In 'site.css':
11436   @tweak-product-quick-view-lightbox-controls-size: 25px;
11437   
11438   
11439    _______  _______  _______  _______  __
11440   |       ||       ||       ||       ||  |
       .^

SyntaxError INCOMPLETE_PARSE Unable to complete parse.
%~~%~++~%~~+++%+++%+++~+~+%~+%%~%+%+%%%+

It looks as if LESS is trying to compile its own error message? I don't know how this happened. As I said, I only followed the tutorial and did nothing else.

As an attempt to debug this, I tried to find the text | || || || || | somewhere in the repository, but it was not found. Then I tried deleting all content from every CSS/LESS file in the styles/ directory (which are pointed at from template.conf), but somehow the error remains.

I should also point out that the website works fine on the actual remote server, and that I did not make any modifications to the website before attempting to run it locally.

Any help on this issue would be greatly appreciated, as my deadline for this project is in 2 weeks.

phensley commented 5 years ago

@JoshuaWise Prefixing this with a disclaimer that I'm not going to be able to provide adequate support for this issue here since it appears to be an problem either with the local development server, the template, or the target site. It doesn't appear to be a bug in the Less compiler (this repo).

You are correct that the compiler is attempting to parse an error message. The only way I'm able to reproduce your site.css 500 error is if I paste the OOPS error text into a local CSS file and refresh the browser.

I'm pinging @nhassan and @georgezzhang to see if they have any suggestions on how to debug your local environment.

spencermerpi commented 4 years ago

I am in an eerily similar spot as @JoshuaWise experienced fronted dev that was hired to edit a squarespace site. This is the error I am getting:

`LESS Compiler said:


| || || || || | | || || || ____|| | | | | || | | || || || |____ | | | || || || || _||___ ||| | || || | _| | _ |||____||| |___||__|

Line Statement

site.css:1 .ProductItem { site.css:1 &-details { site.css:4673 .ProductItem-view-cart a {

ExecuteError UNCOMPARABLE_TYPE: Unable to compare instances of FUNCTION_CALL +%+%%+~%~+~%~+~%+%%%+++%~+%%%%~%`

I tried to find reference to the class .ProductItem in all of the .less files in my styles folder and it is not mentioned anywhere. It seems like it is getting the wrong site.css (where is that file? It is not in my local development template)

phensley commented 4 years ago

@spencermerpi Your version of @squarespace/server may be outdated. Make sure you're on the latest 1.6.2.

spencermerpi commented 4 years ago

@phensley You are a life saver. Updated from 1.6.1 to 1.6.2 and it started working

cunneen commented 4 years ago

Thank you @JoshuaWise for raising this issue and @phensley & @spencermerpi for providing and confirming the fix. This was driving me nuts like you wouldn't believe.