Alcumus / react-doc-viewer

Apache License 2.0
208 stars 101 forks source link

.jg files stuck in loading #71

Open tkayyyyys opened 3 years ago

tkayyyyys commented 3 years ago

Hi,

Firstly, thanks for taking the time to create such a great package.

Images loading from the filesystem work great. But I'm having some issues loading .jpg files from the host URL. Something like: api.localhost.com/img.jpg . React-doc-viewer just sits there spinning. I can, however, view the image fine if I encapsulate it in a html tag <img src="api.localhost.com/img.jpg"/> so I know the link is good.

I was wondering if perhaps my webpack settings might be affecting the behaviour of react-file-viewer? I've atttached a snippet below. Do you see any possible issues?

{
       test: /\.(jpg|png|mp4|mp3)$/, 
          use: {
            loader: "url-loader",
            options: {
              name: "[path][name].[ext]",
              publicPath: "/",
            },
          },
}

I'm using "react-doc-viewer": "^0.1.5" with Typescript (es5) and "react": "^16.13.1". Any tips to debug would be much appreciated!

Cheers