Unexpected token, You may need an appropriate loader to handle this file type.
See original GitHub issueJust created an npm package, and when i use it on my project created by create-react-app got error, any thoughts?
Module parse failed: Unexpected token (8:6)
You may need an appropriate loader to handle this file type.
| render() {
| return (
| <section className="FullWidthLoading-section">
| <Spin
| delay={props.delay}
my npm package
class FullWidthLoading extends Component {
render() {
return (
<section className="FullWidthLoading-section">
<Spin
delay={props.delay}
indicator={props.indicator}
size={props.size}
spinning={props.spinning}
tip={props.tip}
wrapperClassName={props.wrapperClassName}
>
{props.children}
</Spin>
</section>
)
}
};
export default FullWidthLoading;
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
"You may need an appropriate loader to handle this file type ...
Step-2: In order to compile JSX code to es5 babel provides @babel/preset-react package to convert react jsx extension file to native browser ...
Read more >Module parse failed: Unexpected token. You may ... - GitHub
Module parse failed: Unexpected token. You may need an appropriate loader to handle this file type, currently no loaders are configured to process...
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 >Odyssey Lift-off I: "Module parse failed: Unexpected token" Error
You may need an appropriate loader to handle this file type. Looks like webpack is unhappy for some reason. Could be a few...
Read more >You might need an appropriate loader to handle the file type ...
You might need an appropriate loader to handle the file type error. r/react - Hi , I am getting an ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to compile code before publishing. People who use your library shouldn’t need to configure anything to use it.
Here’s a tool that you can use to do that: https://github.com/insin/nwb
you should ship compiled code in your npm package, not raw jsx, since babel/other loaders don’t run on anything inside node_modules.