Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Less does not recompile if imported files changed, even with force option #156

Closed
aDu opened this issue Jul 1, 2018 · 2 comments
Closed

Comments

@aDu
Copy link

aDu commented Jul 1, 2018

I have a file called main.less:
@include "nav"

And nav.less:

    padding: 50px;

Express middleware:

app.use(lessMiddleware(__dirname + '/public', {
    force: true,
    debug: true
}))

Frontend includes only main.css:

<link rel="stylesheet" href="/css/main.css" />

When I run the website, it compiles nicely. But, when I update nav.less, those changes are not reflected (i.e. recompiled) on the website until I restart the express server. I disabled browser caching. However, if I update main.less it recompiles, but not on nav.less. In other words, recompiling does not work in @include files.

Using:

  • Node v8.10.0.
  • Less middleware v3.0.1.
  • Express v4.16.3
@pigeonman99
Copy link

I faced the same issue. Downgrading to 2.2.1 fixed the problem.

@beaulac
Copy link
Contributor

beaulac commented Jan 15, 2019

Was having the same issue; it is linked to an issue in less.js itself: less/less.js#3185

This was fixed as of LESS v3.5.0beta -- Downgrading to 2.2.1 of less-middleware works (because it uses 2.x, and apparently this bug was introduced somewhere in 3.x), but you could also add something like:

  "resolutions": {
    "less": "^3.9.0"
  }

to your package.json, so that less-middleware uses a fixed version of less.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants