Skip to content

Getting - You may need an appropriate loader to handle this file type error #7

Open
@jiteshwadia

Description

@jiteshwadia

Hi, I am facing issue in loading an image.

Error is :

ERROR in ./~/react-native-web-image/index.js
Module parse failed: /Users/MyName/Documents/Learning/Test3/node_modules/react-native-web-image/index.js Unexpected token (12:19)
You may need an appropriate loader to handle this file type.
| 
| class WebImage extends React.Component {
|   static propTypes = {
|     ...View.propTypes,
|     source: SourcePropType.isRequired,
 @ ./index.web.js 9:25-58
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./index.web.js
webpack: Failed to compile.

Webconfig file:

const webpack = require('webpack');

module.exports = {
  entry: {
    main: './index.web.js',
  },
  module: {
    loaders: [
      {
        test: /\.js?$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015', 'react'],
        },
      },
    ],
  },
  resolve: {
    alias: {
      'react-native': 'react-native-web',
    },
  },
};

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions