Comments (5)
Try adding the following to main.ts
in your project:
import { setAssetPath } from '@stencil/core';
...
setAssetPath(`${window.location.origin}/`);
This will set the asset path to something like http://localhost:8100/
or http://example.com/
(wherever your app is served from).
from ionicons.
At the moment our recommendation is to use the setAssetPath
import from @stencil/core
.
from ionicons.
My workaround is just to add them all like this and call the func in the app.component constructor. This way we only have our icons included since we only use outline this also reduced our bundle size yay.
import { addIcons } from 'ionicons'
import {
// ...
} from 'ionicons/icons'
const ALL_ICONS = {
// ...
}
export const addAllIcons = () => addIcons(ALL_ICONS)
from ionicons.
I'm going to move this to the Ionicons project instead. This isn't a bug in Ionicons but rather a missing asset path in your project. Stencil does not know where to look for the SVGs which is why you get an invalid URL error. However, we don't have documentation that shows how to do this, so I think we should add that.
from ionicons.
It works just fine, thank you.
Do you plan to set a default assets path in ionicons or maybe expose this configuration method from ionicons or Ionic framework ? Because I think it's strange to have to import @stencil/core when using only Ionic or ionicons.
from ionicons.
Related Issues (20)
- icon request: Fax HOT 3
- icon request: logo-bootsrap
- bug: external link open in the same tab HOT 2
- icon request: grid of 2,6 and 9 squares HOT 2
- icon request: Generic RFID charge card for charging electric vehicles
- icon request: Kaggle HOT 1
- icon request: twitter-x HOT 2
- feat: Leetcode logo HOT 1
- icon request: HOT 1
- icon request: new logo twitter (x)
- feat: Recommendations/Instructions for building font files HOT 3
- feat: Solution to import icons dynamically in angular
- bug: init error ionIcons. Cannot access 'b' before initialization HOT 2
- bug: Icons do not display when the svg is loaded from a file:// URL by Safari (iOS and MacOS X) HOT 1
- feat: add Web Types HOT 1
- icon request: explicit icon
- icon request: peerlist (peerlist.io)
- icon request: Coding Profile Logos HOT 1
- bug: Memory Leak with Clusterize.js "Detached Elements" HOT 2
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 ionicons.