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

Problem loading a data-uri after updating to 2.0.0 #31

Closed
jessegrosjean opened this issue Jan 5, 2015 · 8 comments
Closed

Problem loading a data-uri after updating to 2.0.0 #31

jessegrosjean opened this issue Jan 5, 2015 · 8 comments

Comments

@jessegrosjean
Copy link

Likely user error, but I can't seem to figure it out...

I just updated a number of packages, including updating the less-loader to version 2.0.0. In the process of doing those updates using a data-uri in my less file seems to have broke:

background-image: data-uri('image/svg+xml;charset=UTF-8', 'dropIndicator.svg');

When I do that I get this error message:

ERROR in ./~/css-loader!./~/less-loader!./src/birch/style/style.less
Module build failed: error evaluating function `data-uri`: Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!
 @ /Users/jesse/Dropbox/Projects:Hacks/Birch/src/birch/style/style.less (line 267, column 19)
 near lines:
    content: "";
    background-image: data-uri('image/svg+xml;charset=UTF-8', 'dropIndicator.svg');
    background-repeat: no-repeat;
 @ ./src/birch/style/style.less 4:14-246

Can someone tell me what must be done to fix the problem? I'm not sure what is meant by the "Use 'resolve'!" suggestion in the error message.

Thanks,
Jesse

@jhnns
Copy link
Member

jhnns commented Jan 5, 2015

That's an issue with less (and has been fixed already)

See less/less.js#2360

@jhnns jhnns closed this as completed Jan 5, 2015
@sethyuan
Copy link

How is it fixed? I don't see any relevancy there.

I'm having the exact problem, with the latest less 2.4.0 and the latest less-loader 2.0.0

@mdreizin
Copy link

@jhnns Unfortunately, it doesn't work for now.

@mdreizin
Copy link

@jhnns A quick note: data-uri(<resource>) will work if <resource> is defined under entry section of webpack.config.js

@jhnns
Copy link
Member

jhnns commented Mar 6, 2015

I'll take a look

@jhnns jhnns reopened this Mar 6, 2015
@joscha
Copy link

joscha commented Mar 8, 2015

it only seems to happen when starting the webpack dev server from scratch. if the less file is already loaded and a url(...) statement is changed into data-uri() it seems to work...

@joscha
Copy link

joscha commented Mar 8, 2015

the workaround with the url-loader in #38 seems to work for this problem as well...

@jhnns
Copy link
Member

jhnns commented Nov 25, 2015

Fix shipped with 2.2.2

@jhnns jhnns closed this as completed Nov 25, 2015
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

5 participants