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

1.1.5 broke relative paths #478

Closed
geddski opened this issue Nov 21, 2011 · 6 comments
Closed

1.1.5 broke relative paths #478

geddski opened this issue Nov 21, 2011 · 6 comments

Comments

@geddski
Copy link

geddski commented Nov 21, 2011

Relative paths are broken in 1.1.5 in less.js in the browser, works fine in Node.

For example:

main.less

body{
  background: url("badger.jpg");
}

When compiled with Node the url will be relative to the LESS file, as it should be. When evaluated in the browser with less.js it's relative to the html file, causing a 404 not found on the image.

Relative paths work just fine in 1.1.4. I ran a git bisect and narrowed it down to this commit: (dist) version bump & build 1.1.5

This is a pretty critical bug, appearing all over the place. Duplicates of this issue:
Issue #464
Issue #471
issue 465

Please address.

@cloudhead
Copy link
Member

Hmm weird.

That commit is just the build commit, so it'll include all commits between 1.1.4 -> 1.1.5... doesn't help..

I'll look into it though.

@geddski
Copy link
Author

geddski commented Nov 22, 2011

Yeah that's the weird thing - I stepped through all the commits of
1.1.4 and it didn't have this bug. 1.1.5 suddenly had it on that first
build commit. Wish I could have narrowed it down further.

@cloudhead
Copy link
Member

Here it is: 1751f13#L0R8

The author didn't patch the regex properly, making it all optional and I didn't catch the mistake when I merged.

I pushed the fix.

@cmyk
Copy link

cmyk commented Nov 23, 2011

Won't work in this case:
I have the style.css in the same directory as the images folder:
@{base-url}:"";
.signal_image.a2 { background-image: url("@{base-url}images/ampel2.png");}

This works, though:
@{base-url}:"images/";
.signal_image.a2 { background-image: url("@{base-url}ampel2.png");}

@cmwelsh
Copy link

cmwelsh commented Nov 29, 2011

This is a very serious bug for those who use LESS extensively in the browser. Please push out a new minor version so people don't waste time debugging this later on.

@geddski
Copy link
Author

geddski commented Nov 29, 2011

He did, it's fixed (mostly). Importing regular CSS files still gets
the paths wrong.

On Nov 29, 2011, at 12:20 PM, "Chris M. Welsh"
reply@reply.github.com
wrote:

This is a very serious bug for those who use LESS extensively in the browser. Please push out a new minor version.


Reply to this email directly or view it on GitHub:
#478 (comment)

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

4 participants