Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with npm svg-country-flags (cannot read toFixed of undefined) #72

Open
neaumusic opened this issue Jan 30, 2020 · 2 comments

Comments

@neaumusic
Copy link

Tried to import svg flags using the following code, but it will not work due to this loader / svgo

import adFlagIcon from 'svg-country-flags/svg/ad.svg';
import aeFlagIcon from 'svg-country-flags/svg/ae.svg';
import afFlagIcon from 'svg-country-flags/svg/af.svg';
import agFlagIcon from 'svg-country-flags/svg/ag.svg';
import aiFlagIcon from 'svg-country-flags/svg/ai.svg';
import alFlagIcon from 'svg-country-flags/svg/al.svg';
import amFlagIcon from 'svg-country-flags/svg/am.svg';
import anFlagIcon from 'svg-country-flags/svg/an.svg';
import aoFlagIcon from 'svg-country-flags/svg/ao.svg';
import aqFlagIcon from 'svg-country-flags/svg/aq.svg';
import arFlagIcon from 'svg-country-flags/svg/ar.svg';
import asFlagIcon from 'svg-country-flags/svg/as.svg';
import atFlagIcon from 'svg-country-flags/svg/at.svg';
import auFlagIcon from 'svg-country-flags/svg/au.svg';
import awFlagIcon from 'svg-country-flags/svg/aw.svg';
import axFlagIcon from 'svg-country-flags/svg/ax.svg';
import azFlagIcon from 'svg-country-flags/svg/az.svg';
import baFlagIcon from 'svg-country-flags/svg/ba.svg';
import bbFlagIcon from 'svg-country-flags/svg/bb.svg';
import bdFlagIcon from 'svg-country-flags/svg/bd.svg';
import beFlagIcon from 'svg-country-flags/svg/be.svg';
import bfFlagIcon from 'svg-country-flags/svg/bf.svg';
import bgFlagIcon from 'svg-country-flags/svg/bg.svg';
import bhFlagIcon from 'svg-country-flags/svg/bh.svg';
import biFlagIcon from 'svg-country-flags/svg/bi.svg';
import bjFlagIcon from 'svg-country-flags/svg/bj.svg';
import blFlagIcon from 'svg-country-flags/svg/bl.svg';
import bmFlagIcon from 'svg-country-flags/svg/bm.svg';
import bnFlagIcon from 'svg-country-flags/svg/bn.svg';
import boFlagIcon from 'svg-country-flags/svg/bo.svg';
import bqFlagIcon from 'svg-country-flags/svg/bq.svg';
import brFlagIcon from 'svg-country-flags/svg/br.svg';
import bsFlagIcon from 'svg-country-flags/svg/bs.svg';
import btFlagIcon from 'svg-country-flags/svg/bt.svg';
import bvFlagIcon from 'svg-country-flags/svg/bv.svg';
import bwFlagIcon from 'svg-country-flags/svg/bw.svg';
import byFlagIcon from 'svg-country-flags/svg/by.svg';
import bzFlagIcon from 'svg-country-flags/svg/bz.svg';
import caFlagIcon from 'svg-country-flags/svg/ca.svg';
import ccFlagIcon from 'svg-country-flags/svg/cc.svg';
import cdFlagIcon from 'svg-country-flags/svg/cd.svg';
import cfFlagIcon from 'svg-country-flags/svg/cf.svg';
import cgFlagIcon from 'svg-country-flags/svg/cg.svg';
import chFlagIcon from 'svg-country-flags/svg/ch.svg';
import ciFlagIcon from 'svg-country-flags/svg/ci.svg';
import ckFlagIcon from 'svg-country-flags/svg/ck.svg';
import clFlagIcon from 'svg-country-flags/svg/cl.svg';
import cmFlagIcon from 'svg-country-flags/svg/cm.svg';
import cnFlagIcon from 'svg-country-flags/svg/cn.svg';
import coFlagIcon from 'svg-country-flags/svg/co.svg';
import crFlagIcon from 'svg-country-flags/svg/cr.svg';
import cuFlagIcon from 'svg-country-flags/svg/cu.svg';
import cvFlagIcon from 'svg-country-flags/svg/cv.svg';
import cwFlagIcon from 'svg-country-flags/svg/cw.svg';
import cxFlagIcon from 'svg-country-flags/svg/cx.svg';
import cyFlagIcon from 'svg-country-flags/svg/cy.svg';
import czFlagIcon from 'svg-country-flags/svg/cz.svg';
import deFlagIcon from 'svg-country-flags/svg/de.svg';
import djFlagIcon from 'svg-country-flags/svg/dj.svg';
import dkFlagIcon from 'svg-country-flags/svg/dk.svg';
import dmFlagIcon from 'svg-country-flags/svg/dm.svg';
import doFlagIcon from 'svg-country-flags/svg/do.svg';
import dzFlagIcon from 'svg-country-flags/svg/dz.svg';
import ecFlagIcon from 'svg-country-flags/svg/ec.svg';
import eeFlagIcon from 'svg-country-flags/svg/ee.svg';
import egFlagIcon from 'svg-country-flags/svg/eg.svg';
import ehFlagIcon from 'svg-country-flags/svg/eh.svg';
import erFlagIcon from 'svg-country-flags/svg/er.svg';
import esFlagIcon from 'svg-country-flags/svg/es.svg';
import etFlagIcon from 'svg-country-flags/svg/et.svg';
import euFlagIcon from 'svg-country-flags/svg/eu.svg';
import fiFlagIcon from 'svg-country-flags/svg/fi.svg';
import fjFlagIcon from 'svg-country-flags/svg/fj.svg';
import fkFlagIcon from 'svg-country-flags/svg/fk.svg';
import fmFlagIcon from 'svg-country-flags/svg/fm.svg';
import foFlagIcon from 'svg-country-flags/svg/fo.svg';
import frFlagIcon from 'svg-country-flags/svg/fr.svg';
import gaFlagIcon from 'svg-country-flags/svg/ga.svg';
import gbEngFlagIcon from 'svg-country-flags/svg/gb-eng.svg';
import gbNirFlagIcon from 'svg-country-flags/svg/gb-nir.svg';
import gbSctFlagIcon from 'svg-country-flags/svg/gb-sct.svg';
import gbWlsFlagIcon from 'svg-country-flags/svg/gb-wls.svg';
import gbFlagIcon from 'svg-country-flags/svg/gb.svg';
import gdFlagIcon from 'svg-country-flags/svg/gd.svg';
import geFlagIcon from 'svg-country-flags/svg/ge.svg';
import gfFlagIcon from 'svg-country-flags/svg/gf.svg';
import ggFlagIcon from 'svg-country-flags/svg/gg.svg';
import ghFlagIcon from 'svg-country-flags/svg/gh.svg';
import giFlagIcon from 'svg-country-flags/svg/gi.svg';
import glFlagIcon from 'svg-country-flags/svg/gl.svg';
import gmFlagIcon from 'svg-country-flags/svg/gm.svg';
import gnFlagIcon from 'svg-country-flags/svg/gn.svg';
import gpFlagIcon from 'svg-country-flags/svg/gp.svg';
import gqFlagIcon from 'svg-country-flags/svg/gq.svg';
import grFlagIcon from 'svg-country-flags/svg/gr.svg';
import gsFlagIcon from 'svg-country-flags/svg/gs.svg';
import gtFlagIcon from 'svg-country-flags/svg/gt.svg';
import guFlagIcon from 'svg-country-flags/svg/gu.svg';
import gwFlagIcon from 'svg-country-flags/svg/gw.svg';
import gyFlagIcon from 'svg-country-flags/svg/gy.svg';
import hkFlagIcon from 'svg-country-flags/svg/hk.svg';
import hmFlagIcon from 'svg-country-flags/svg/hm.svg';
import hnFlagIcon from 'svg-country-flags/svg/hn.svg';
import hrFlagIcon from 'svg-country-flags/svg/hr.svg';
import htFlagIcon from 'svg-country-flags/svg/ht.svg';
import huFlagIcon from 'svg-country-flags/svg/hu.svg';
import idFlagIcon from 'svg-country-flags/svg/id.svg';
import ieFlagIcon from 'svg-country-flags/svg/ie.svg';
import ilFlagIcon from 'svg-country-flags/svg/il.svg';
import imFlagIcon from 'svg-country-flags/svg/im.svg';
import inFlagIcon from 'svg-country-flags/svg/in.svg';
import ioFlagIcon from 'svg-country-flags/svg/io.svg';
import iqFlagIcon from 'svg-country-flags/svg/iq.svg';
import irFlagIcon from 'svg-country-flags/svg/ir.svg';
import isFlagIcon from 'svg-country-flags/svg/is.svg';
import itFlagIcon from 'svg-country-flags/svg/it.svg';
import jeFlagIcon from 'svg-country-flags/svg/je.svg';
import jmFlagIcon from 'svg-country-flags/svg/jm.svg';
import joFlagIcon from 'svg-country-flags/svg/jo.svg';
import jpFlagIcon from 'svg-country-flags/svg/jp.svg';
import keFlagIcon from 'svg-country-flags/svg/ke.svg';
import kgFlagIcon from 'svg-country-flags/svg/kg.svg';
import khFlagIcon from 'svg-country-flags/svg/kh.svg';
import kiFlagIcon from 'svg-country-flags/svg/ki.svg';
import kmFlagIcon from 'svg-country-flags/svg/km.svg';
import knFlagIcon from 'svg-country-flags/svg/kn.svg';
import kpFlagIcon from 'svg-country-flags/svg/kp.svg';
import krFlagIcon from 'svg-country-flags/svg/kr.svg';
import kwFlagIcon from 'svg-country-flags/svg/kw.svg';
import kyFlagIcon from 'svg-country-flags/svg/ky.svg';
import kzFlagIcon from 'svg-country-flags/svg/kz.svg';
import laFlagIcon from 'svg-country-flags/svg/la.svg';
import lbFlagIcon from 'svg-country-flags/svg/lb.svg';
import lcFlagIcon from 'svg-country-flags/svg/lc.svg';
import liFlagIcon from 'svg-country-flags/svg/li.svg';
import lkFlagIcon from 'svg-country-flags/svg/lk.svg';
import lrFlagIcon from 'svg-country-flags/svg/lr.svg';
import lsFlagIcon from 'svg-country-flags/svg/ls.svg';
import ltFlagIcon from 'svg-country-flags/svg/lt.svg';
import luFlagIcon from 'svg-country-flags/svg/lu.svg';
import lvFlagIcon from 'svg-country-flags/svg/lv.svg';
import lyFlagIcon from 'svg-country-flags/svg/ly.svg';
import maFlagIcon from 'svg-country-flags/svg/ma.svg';
import mcFlagIcon from 'svg-country-flags/svg/mc.svg';
import mdFlagIcon from 'svg-country-flags/svg/md.svg';
import meFlagIcon from 'svg-country-flags/svg/me.svg';
import mfFlagIcon from 'svg-country-flags/svg/mf.svg';
import mgFlagIcon from 'svg-country-flags/svg/mg.svg';
import mhFlagIcon from 'svg-country-flags/svg/mh.svg';
import mkFlagIcon from 'svg-country-flags/svg/mk.svg';
import mlFlagIcon from 'svg-country-flags/svg/ml.svg';
import mmFlagIcon from 'svg-country-flags/svg/mm.svg';
import mnFlagIcon from 'svg-country-flags/svg/mn.svg';
import moFlagIcon from 'svg-country-flags/svg/mo.svg';
import mpFlagIcon from 'svg-country-flags/svg/mp.svg';
import mqFlagIcon from 'svg-country-flags/svg/mq.svg';
import mrFlagIcon from 'svg-country-flags/svg/mr.svg';
import msFlagIcon from 'svg-country-flags/svg/ms.svg';
import mtFlagIcon from 'svg-country-flags/svg/mt.svg';
import muFlagIcon from 'svg-country-flags/svg/mu.svg';
import mvFlagIcon from 'svg-country-flags/svg/mv.svg';
import mwFlagIcon from 'svg-country-flags/svg/mw.svg';
import mxFlagIcon from 'svg-country-flags/svg/mx.svg';
import myFlagIcon from 'svg-country-flags/svg/my.svg';
import mzFlagIcon from 'svg-country-flags/svg/mz.svg';
import naFlagIcon from 'svg-country-flags/svg/na.svg';
import ncFlagIcon from 'svg-country-flags/svg/nc.svg';
import neFlagIcon from 'svg-country-flags/svg/ne.svg';
import nfFlagIcon from 'svg-country-flags/svg/nf.svg';
import ngFlagIcon from 'svg-country-flags/svg/ng.svg';
import niFlagIcon from 'svg-country-flags/svg/ni.svg';
import nlFlagIcon from 'svg-country-flags/svg/nl.svg';
import noFlagIcon from 'svg-country-flags/svg/no.svg';
import npFlagIcon from 'svg-country-flags/svg/np.svg';
import nrFlagIcon from 'svg-country-flags/svg/nr.svg';
import nuFlagIcon from 'svg-country-flags/svg/nu.svg';
import nzFlagIcon from 'svg-country-flags/svg/nz.svg';
import omFlagIcon from 'svg-country-flags/svg/om.svg';
import paFlagIcon from 'svg-country-flags/svg/pa.svg';
import peFlagIcon from 'svg-country-flags/svg/pe.svg';
import pfFlagIcon from 'svg-country-flags/svg/pf.svg';
import pgFlagIcon from 'svg-country-flags/svg/pg.svg';
import phFlagIcon from 'svg-country-flags/svg/ph.svg';
import pkFlagIcon from 'svg-country-flags/svg/pk.svg';
import plFlagIcon from 'svg-country-flags/svg/pl.svg';
import pmFlagIcon from 'svg-country-flags/svg/pm.svg';
import pnFlagIcon from 'svg-country-flags/svg/pn.svg';
import prFlagIcon from 'svg-country-flags/svg/pr.svg';
import psFlagIcon from 'svg-country-flags/svg/ps.svg';
import ptFlagIcon from 'svg-country-flags/svg/pt.svg';
import pwFlagIcon from 'svg-country-flags/svg/pw.svg';
import pyFlagIcon from 'svg-country-flags/svg/py.svg';
import qaFlagIcon from 'svg-country-flags/svg/qa.svg';
import reFlagIcon from 'svg-country-flags/svg/re.svg';
import roFlagIcon from 'svg-country-flags/svg/ro.svg';
import rsFlagIcon from 'svg-country-flags/svg/rs.svg';
import ruFlagIcon from 'svg-country-flags/svg/ru.svg';
import rwFlagIcon from 'svg-country-flags/svg/rw.svg';
import saFlagIcon from 'svg-country-flags/svg/sa.svg';
import sbFlagIcon from 'svg-country-flags/svg/sb.svg';
import scFlagIcon from 'svg-country-flags/svg/sc.svg';
import sdFlagIcon from 'svg-country-flags/svg/sd.svg';
import seFlagIcon from 'svg-country-flags/svg/se.svg';
import sgFlagIcon from 'svg-country-flags/svg/sg.svg';
import shFlagIcon from 'svg-country-flags/svg/sh.svg';
import siFlagIcon from 'svg-country-flags/svg/si.svg';
import sjFlagIcon from 'svg-country-flags/svg/sj.svg';
import skFlagIcon from 'svg-country-flags/svg/sk.svg';
import slFlagIcon from 'svg-country-flags/svg/sl.svg';
import smFlagIcon from 'svg-country-flags/svg/sm.svg';
import snFlagIcon from 'svg-country-flags/svg/sn.svg';
import soFlagIcon from 'svg-country-flags/svg/so.svg';
import srFlagIcon from 'svg-country-flags/svg/sr.svg';
import ssFlagIcon from 'svg-country-flags/svg/ss.svg';
import stFlagIcon from 'svg-country-flags/svg/st.svg';
import svFlagIcon from 'svg-country-flags/svg/sv.svg';
import sxFlagIcon from 'svg-country-flags/svg/sx.svg';
import syFlagIcon from 'svg-country-flags/svg/sy.svg';
import szFlagIcon from 'svg-country-flags/svg/sz.svg';
import tcFlagIcon from 'svg-country-flags/svg/tc.svg';
import tdFlagIcon from 'svg-country-flags/svg/td.svg';
import tfFlagIcon from 'svg-country-flags/svg/tf.svg';
import tgFlagIcon from 'svg-country-flags/svg/tg.svg';
import thFlagIcon from 'svg-country-flags/svg/th.svg';
import tjFlagIcon from 'svg-country-flags/svg/tj.svg';
import tkFlagIcon from 'svg-country-flags/svg/tk.svg';
import tlFlagIcon from 'svg-country-flags/svg/tl.svg';
import tmFlagIcon from 'svg-country-flags/svg/tm.svg';
import tnFlagIcon from 'svg-country-flags/svg/tn.svg';
import toFlagIcon from 'svg-country-flags/svg/to.svg';
import trFlagIcon from 'svg-country-flags/svg/tr.svg';
import ttFlagIcon from 'svg-country-flags/svg/tt.svg';
import tvFlagIcon from 'svg-country-flags/svg/tv.svg';
import twFlagIcon from 'svg-country-flags/svg/tw.svg';
import tzFlagIcon from 'svg-country-flags/svg/tz.svg';
import uaFlagIcon from 'svg-country-flags/svg/ua.svg';
import ugFlagIcon from 'svg-country-flags/svg/ug.svg';
import umFlagIcon from 'svg-country-flags/svg/um.svg';
import usFlagIcon from 'svg-country-flags/svg/us.svg';
import uyFlagIcon from 'svg-country-flags/svg/uy.svg';
import uzFlagIcon from 'svg-country-flags/svg/uz.svg';
import vaFlagIcon from 'svg-country-flags/svg/va.svg';
import vcFlagIcon from 'svg-country-flags/svg/vc.svg';
import veFlagIcon from 'svg-country-flags/svg/ve.svg';
import vgFlagIcon from 'svg-country-flags/svg/vg.svg';
import viFlagIcon from 'svg-country-flags/svg/vi.svg';
import vnFlagIcon from 'svg-country-flags/svg/vn.svg';
import vuFlagIcon from 'svg-country-flags/svg/vu.svg';
import wfFlagIcon from 'svg-country-flags/svg/wf.svg';
import wsFlagIcon from 'svg-country-flags/svg/ws.svg';
import xkFlagIcon from 'svg-country-flags/svg/xk.svg';
import yeFlagIcon from 'svg-country-flags/svg/ye.svg';
import ytFlagIcon from 'svg-country-flags/svg/yt.svg';
import zaFlagIcon from 'svg-country-flags/svg/za.svg';
import zmFlagIcon from 'svg-country-flags/svg/zm.svg';
import zwFlagIcon from 'svg-country-flags/svg/zw.svg';
@ljharb
Copy link
Collaborator

ljharb commented Jan 30, 2020

Presumably each one of those by itself also causes the same error; can you provide the full stack trace?

@wenerme
Copy link

wenerme commented Mar 5, 2020

Problem like this svg/svgo#990

Disable svgo in inline-react-svg, pre-run svgo on svgs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants