webpack-contrib / file-loader

File Loader
MIT License
1.86k stars 257 forks source link

Outputting [Object object] instead of URL for CSS file url functions #353

Closed IronSean closed 4 years ago

IronSean commented 4 years ago

Expected Behavior

generate CSS like this (as it did in file-loader 4.x):

body {
    background: url(http://localhost:8080/dist/bce4508….png) #ffffff;
}

Actual Behavior

generates CSS as

body {
  background: url([object Module]) #ffffff;
}

Code

The use of file-loader is completely default currently, I'm working on a repro below as the whole webpack config is quite large.

How Do We Reproduce?

I'm working on a repro I can provide.

alexander-akait commented 4 years ago

update css-loader to latest version, or you can disable ES module syntax using esModule: false