Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

Error in ./UploadIcon.svg #57

Open
davechan813 opened this issue Jul 11, 2018 · 8 comments
Open

Error in ./UploadIcon.svg #57

davechan813 opened this issue Jul 11, 2018 · 8 comments

Comments

@davechan813
Copy link

Hi guys, I am having this problem that when I import, it said "Error in ./UploadIcon.svg". Any one know how to fix it?

Thank you so much!

screen shot 2018-07-11 at 15 20 40

@donalmurtagh
Copy link
Contributor

@davechan813 which file are you importing when trying to use the image upload component?

@davechan813
Copy link
Author

@donalmurtagh I did nothing but just "import ImageUploader from 'react-images-upload';"

@ivnnv
Copy link
Collaborator

ivnnv commented Jul 13, 2018

@donalmurtagh whats your envirmnent? Create React App or a custom project using webpack?

This issue problably refers to #21 , you need your project to properly be able to load svg files with a webpack svg loader for example (or use Parcel in your project as the bundler).

@donalmurtagh
Copy link
Contributor

@IvanLinos I'm using create-react-app, but I'm not experiencing this problem, @davechan813 is

@ivnnv
Copy link
Collaborator

ivnnv commented Jul 16, 2018

@davechan813 could you confirm are you using create-react-app without ejecting and in case, which version of it are you using ?

@makethisbuildthat
Copy link

i am having the same issue with UploadIcon.svg. I imported ImageUploader, without even using this component, i immediately getting a module parse failed error. I'm using reactGo boilerplate. Please help.

@Kiel-H-Byrne
Copy link

Same issue.... right after install and dropping onto a blank component i get:
Uncaught Error: Cannot find module './UploadIcon.svg'

@ghost
Copy link

ghost commented Sep 5, 2018

I had the same issue, and resolved it by adding:

      {
        test: /.*\.svg$/,
        loader: 'svg-inline-loader',
      },

to module.rules in my webpack config. It then compiles successfully but the icon doesn't actually get loaded correctly -- however, if you set withIcon={false} on the ImageUploader component, that issue is rendered moot.

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

No branches or pull requests

5 participants