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

Cannot load images #31

Closed
tatemz opened this issue Oct 13, 2016 · 8 comments
Closed

Cannot load images #31

tatemz opened this issue Oct 13, 2016 · 8 comments
Labels

Comments

@tatemz
Copy link

tatemz commented Oct 13, 2016

I added this line into home.jsx after a fresh clone:

import testImage from '../images/test.png';

And I got this error after running gulp dev:

Register plugins failed { SyntaxError: ... Development/node/electrode-boilerplate-universal-react-node/client/images/test.png: Unexpected character '�' (1:0)...
@jchip
Copy link
Member

jchip commented Oct 13, 2016

Thanks, a few issues in the generator have been fixed and this was one of them, but the boilerplate still has them since it was generated a while back. Will be manually fixing this boilerplate soon.

@jchip
Copy link
Member

jchip commented Oct 13, 2016

the material-ui sample app actually has the image fix https://github.com/electrode-io/electrode-react-sample-material-ui

@jchip
Copy link
Member

jchip commented Oct 14, 2016

To get isomorphic images working, update server/index.js with this https://github.com/electrode-io/electrode-react-sample-material-ui/blob/master/server/index.js#L38-L40.

@ananavati ananavati added the bug label Oct 14, 2016
@ananavati
Copy link
Contributor

ananavati commented Oct 18, 2016

@rbudiharso
Copy link
Contributor

The isomorphic loader works only for development, it doesn't run after you run gulp build and gulp server-prod the images are not showing. Here's how to reproduce it:

git clone https://github.com/electrode-io/electrode-boilerplate-universal-react-node.git
cd electrode-boilerplate-universal-react-node
npm install
gulp build
NODE_ENV=production gulp server-prod

screenshot from 2016-11-04 10-40-36

jchip pushed a commit that referenced this issue Dec 7, 2016
picked minimum versions that incorporate the latest big security issues
@EternallLight
Copy link

EternallLight commented Aug 27, 2018

Hi,

I'm having a similar issue with electrode on Mac out of the box with a new app with totally default settings:

<my project path>/src/client/images/electrode.png: Unexpected character '�' (1:0)
> 1 | �PNG
    | ^
  2 | 
  3 | 
  4 | IHDRHU�GgAMA��

I tried other PNG or JPG files and they all cause the same error.

Node JS version: v9.11.2

What can you suggest to resolve the issue?

@thiagoneves
Copy link

I´m facing the same problem.

<my project path>/src/client/images/electrode.png: Unexpected character '�' (1:0)

How can i fix it?

@EternallLight
Copy link

@thiagoneves

For me, it was because I tried to used Express instead of Hapi. With Hapi, I also had that error, but at some point it was gone, and I don't know what changed. It just started working for all newly generated projects.

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

No branches or pull requests

6 participants