Comments (7)
@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.
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.
@equinusocio Reopening the issue. I've identified the cause. Working on it.
from wc-loader.
Fixed in commit 9bb2b83.
Solution
-
Update to v1.1.10
-
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.
@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.
@equinusocio absolute path is working in 1.1.12. See the following screenshots.
Could you check the access permissions of assets folder?
from wc-loader.
@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)
- Use polymer-analyzer
- sourcemaps and breakpoints in IDE impossible? HOT 2
- Does not work for AppLocalizeBehavior HOT 10
- Does not support quotes in urls in css
- ES6 transpiling + WC loader not working HOT 1
- Code is generated to load whitespace HOT 2
- minify html option HOT 1
- How to use lib when importing in index.html with HtmlWebpackPlugin HOT 1
- Tries to access publicPath of undefined HOT 1
- Externally hosted web components? HOT 2
- Child combinator in CSS is replaced with > HOT 6
- Creating extra <dom-module> element HOT 1
- Loader fails? HOT 2
- Loader fails to compile polymer.html HOT 2
- Support for <link rel="stylesheet"> with an SCSS target
- Unbundled dev mode with wc-loader
- Support for webpack@4 HOT 1
- Write tests HOT 2
- import behaviors looks incorrect HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wc-loader.