question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

You may need an appropriate loader to handle this file type.

See original GitHub issue

When I try import like example:

import LineRipple from '@material/react-line-ripple';

And try use:

class Foo extends Components {
    render() {
        return(
            <div>
                <LineRipple />
                ...
            </div>
        )
    }
}

Then throw:

ERROR in ./node_modules/@material/react-line-ripple/index.js
Module parse failed: Unexpected token (8:14)
You may need an appropriate loader to handle this file type.
| export default class LineRipple extends Component {
|
|   foundation_ = null;
|
|   state = {
...

Someone has a proposal solution for that? Thank’s guys 😉

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
ch4nd4ncommented, May 11, 2018

+1

Example - https://codesandbox.io/s/vy9qkj7o60

I tried out with create-react-app and it fails with following response.

Failed to compile.

./node_modules/@material/react-button/index.js
Module parse failed: Unexpected token (17:6)
You may need an appropriate loader to handle this file type.
|       initRipple,
|       unbounded, // eslint-disable-line no-unused-vars
|       ...otherProps
|     } = this.props;
|

package.json

{
  "name": "chandan",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material/react-button": "^0.1.0",
    "react": "^16.3.2",
    "react-dom": "^16.3.2",
    "react-scripts": "1.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

App.js

import React, { Component } from 'react';

import Button from '@material/react-button';

class App extends Component {
  render() {
    return (
      <div className="App">
          <Button>
            Click Me!
          </Button>
      </div>
    );
  }
}

export default App;
0reactions
devxpycommented, Jun 1, 2018

Dope!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"You may need an appropriate loader to handle this file type ...
js file is doing is importing react, but it seems like the 'babel-loader' is not working. I am using 'babel-loader' 6.0.0. javascript ·...
Read more >
You may need an appropriate loader to handle this file type ...
I 'm having a problem configuring Webpack for Typescript and React. After running the NPM script: webpack serves ./webpack/webpack.config.ts ...
Read more >
Module parse failed: Unexpected token. You may ... - GitHub
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. #996.
Read more >
You might need an appropriate loader to handle the file type ...
You may need an appropriate loader to handle this file type. | var tokenString = localStorage.getItem("token");. | var userToken = JSON.parse( ...
Read more >
CSS : You may need an appropriate loader to handle this file ...
CSS : You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found