Giter Site home page Giter Site logo

Comments (7)

aruntk avatar aruntk commented on May 25, 2024

@equinusocio try using assets/ instead of /assets/. Latter one refers to assets folder inside your root folder. As the error suggests webpack could not resolve the absolute path /assets/images/thread-row-placeholder.svg.

Or use absolute path to svg file. /path/to/assets/.

:host {
  display: flex;
  contain: content;
  position: relative;
  overflow: hidden;
  background-image: url("assets/images/thread-row-placeholder.svg");
}

Refer the example here https://github.com/aruntk/polymer-webpack-demo/blob/master/src/components/example-app.html#L25

Dont forget to define image loaders in your webpack config. eg https://github.com/aruntk/polymer-webpack-demo/blob/master/webpack.config.js#L22-L28

from wc-loader.

equinusocio avatar equinusocio commented on May 25, 2024

I'm already using file-loader and i get this error anyway. My assets folder live inside the root.

Does the wc-loader follow the css url's starting from the css file?

from wc-loader.

aruntk avatar aruntk commented on May 25, 2024

@equinusocio Reopening the issue. I've identified the cause. Working on it.

from wc-loader.

aruntk avatar aruntk commented on May 25, 2024

Fixed in commit 9bb2b83.

Solution

  1. Update to v1.1.10

  2. Change webpack config according to https://github.com/aruntk/wc-loader#root-relative-urls

Update

I've released 1.1.11 with dependencies updated. So you might want to try that one instead of 1.1.10

from wc-loader.

equinusocio avatar equinusocio commented on May 25, 2024

@aruntk I tried 1.1.12 (with file-loader) and i get the same error:

with root=/ and css url /assets/images/thread-row-placeholder.svg
it search for — //assets/images/thread-row-placeholder.svg — and return the Module not found error


with root=/ and css url assets/images/thread-row-placeholder.svg
it search for — ./assets/images/thread-row-placeholder.svg — and return the Module not found error

I'm missing something?


EDIT

It works if i set root=/ and the css url to ../../../assets/images/thread-row-placeholder.svg.

EDIT 2

I solved by removing root=/ and set useRelativePath: false to file-loader. This is the only way found to get it works. @aruntk Maybe you should write a bit of documentation.

from wc-loader.

aruntk avatar aruntk commented on May 25, 2024

@equinusocio absolute path is working in 1.1.12. See the following screenshots.

screen shot 2017-08-10 at 1 31 49 pm

screen shot 2017-08-10 at 1 32 36 pm

see the background image.
screen shot 2017-08-10 at 1 32 49 pm

Could you check the access permissions of assets folder?

from wc-loader.

aruntk avatar aruntk commented on May 25, 2024

@equinusocio It seems to be working fine in my system even without setting useRelativePath: false.

This is my webpack config https://github.com/aruntk/polymer-webpack-demo/blob/master/webpack.config.js#L43

I'll try to add better documentation. Thanks for the suggestion :)

from wc-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.