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

Module parse failed: Unexpected token #99

Open
johnreytanquinco opened this issue Oct 1, 2018 · 0 comments
Open

Module parse failed: Unexpected token #99

johnreytanquinco opened this issue Oct 1, 2018 · 0 comments

Comments

@johnreytanquinco
Copy link

npm -v 5.6.0

I added "react-native-spinkit": "^1.1.1" in my package.json file then run npm install. I see that package-lock.json was also updated with the package I added. But when I run webpack, I am getting the error message below.

ERROR in ./~/react-native-spinkit/index.js
Module parse failed: /opt/app-root/src/themes/bootstrap_patterns/node_modules/react-native-spinkit/index.js Unexpected token (16:18)
You may need an appropriate loader to handle this file type.
| class Spinkit extends React.Component {
| 
| 	static propTypes = {
| 		type: PropTypes.string,
| 		/**
 @ ./js/index.js 19:26-57
 @ multi ./js/index.js ./webpack.config.js

I just added the Spinner component in my index.js file header and run webpack.

import React from 'react';
import { render } from 'react-dom';
import Chart from './Chart';
import Spinner from 'react-native-spinkit';
...

webpack.config.js

module.exports = {
  entry: ['./js/index.js'],
  output: {
    path: __dirname + "/js/",
    filename: 'favorite.bundle.js'
  },
  module: {
    loaders: [
      {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
      { test: /\.css$/, loader: "style-loader!css-loader" }
    ]
  }
};

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

No branches or pull requests

1 participant