ReactJs can't import IMG_VAR from './images/name.jpg' with babel / React / Webpack reactjs canvas,reactjs canvas example,reactjs cannot read property of

Background (possibly irrelevent): I have a large react project I'm changing gulp -> webpack. It's isomorphic so I'm using webpack-isomorphic-tools.

So I have this line which no longer works:

const CANDLE_JPG = require('./assets/candle.jpg'); which returns error:

.assets/candle.jpg should not be assigned to variable.

But if I change it to:

import CANDLE_JPG from './assets/candle.jpg' I get the error:

./assets/candle.jpg should not be imported using default imports.

Thoughts: I believe it could be some issue with babel compilation, but I'm not sure. I've used require('babel-register') and my ".bablerc" contains presets es2015, react, and stage-0 and includes plugins transform-runtime, and react-hot-loader/babel.

File Loader:

const fileLoader = {
  loader: require.resolve('file-loader'),
  exclude: [/\.js$/, /\.html$/, /\.hbs$/, /\.json$/],
  options: {
    name: 'assets/images/[name].[hash:8].[ext]',
    emitFile: true
  }
};
Answer:1



  1. reactjs canvas
  2. reactjs canvas example
  3. reactjs cannot read property of undefined
  4. reactjs can't type in input
  5. reactjs cannot find module
  6. reactjs cannot get /
  7. reactjs cannot access before initialization
  8. reactjs canvas draw

Is there a way to make the calendar glyphicon open the datetime picker when clicked? I currently just have the button but it can't be clicked. I’ve been struggling to find something that’s specific to ...

Is there a way to make the calendar glyphicon open the datetime picker when clicked? I currently just have the button but it can't be clicked. I’ve been struggling to find something that’s specific to ...

I have just configured React Native FCM, when I try to start the packager: npm install && gradlew clean I get the following error: enter code here E:\projects\deets-mobile-sp\android\app\...

I have just configured React Native FCM, when I try to start the packager: npm install && gradlew clean I get the following error: enter code here E:\projects\deets-mobile-sp\android\app\...