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 with webpack #31

Closed
ayozebarrera opened this issue Mar 22, 2016 · 6 comments
Closed

Module parse failed with webpack #31

ayozebarrera opened this issue Mar 22, 2016 · 6 comments

Comments

@ayozebarrera
Copy link

Same as #23

I installed your package and has the following error You may need an appropriate loader to handle this file type. in react-pivot/index.jsx

I have others components with jsx working well time ago... any solution?

@ayozebarrera
Copy link
Author

I had to add the following loaders to my webpack.config.js

{
  test: /\.(js|jsx|es6)$/,
  include: /react-pivot/,
  loader: 'babel'
}

and will solve this problem. After that I had the same error but in a .css file used by index.jsx so had to add the following, in loaders too:

{ 
  test: /\.css$/,
  loader: "style-loader!css-loader"
}

After this, I can render the component but with the following warning #32

@davidguttman
Copy link
Owner

Unfortunately, I don't use webpack, so I don't really know why that's needed.

Happy to take a PR if there's anything simple to make react-pivot work better with it.

@PrudhviRaj5
Copy link

@ayozebarrera Did you figure this out? The same error occurs to me and I'm using babel, webpack server and using ES6 in my complete project. I tried what you suggested in modifying webpack.config.js, but still no luck :(

@PrudhviRaj5
Copy link

I added this line to my webpack.config.js
{test: /\.(js|jsx|es6)$/, include: /react-pivot/, loader: "babel", query: {presets: ["es2015", "react"]}},
and voila! it started working 👍

@ayozebarrera
Copy link
Author

Great @PrudhviRaj5. I had that query aswell but not on the same place

@ayozebarrera
Copy link
Author

Clossing Issue.

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

3 participants