Code Monkey home page Code Monkey logo

Comments (5)

liamdebeasi avatar liamdebeasi commented on September 27, 2024 1

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.

liamdebeasi avatar liamdebeasi commented on September 27, 2024 1

At the moment our recommendation is to use the setAssetPath import from @stencil/core.

from ionicons.

muuvmuuv avatar muuvmuuv commented on September 27, 2024

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.

liamdebeasi avatar liamdebeasi commented on September 27, 2024

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.

mamillastre avatar mamillastre commented on September 27, 2024

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)

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.