less / less/less.js

Inconsistent behaviour when refreshing circular referenced templates

Open
#1,731 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug low priority
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

Create template called circular.less as below:

@import "circular.less";

Declare it in the head element via a link element.

When loading the page for the first time, it only loads circular.less once.

In the developer console, type:

less.refresh()

Verify that it loads circular.less 3 times.

If the circular reference occurs across 2 files, it will load the 2 files twice.
If the circular reference occurs across 3 files, it will load the 3 files once then the first 2 again.

I'm not sure what the expected behaviour is, but this seems a little fishy.

This is vaguely related to #1484.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the circular.less case by loading it through a link element and calling less.refresh() in the developer console, then compare it with two- and three-file cycles. Review the related behavior in issue #1484; done should mean the expected refresh behavior is established and circular references no longer cause inconsistent repeated loads.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.