Issue with React component and webpack
See original GitHub issueI’m trying to use uppy but I get a webpack error whenever I try to use a UI element.
I have tried
import { Dashboard } from '@uppy/react';
import { Dashboard } from '@uppy/dashboard';
import Dashboard from '@uppy/react/lib/Dashboard'
but I keep getting several errors like these:
ERROR in ./node_modules/@uppy/status-bar/src/StatusBar.js 117:4
Module parse failed: Unexpected token (117:4)
You may need an appropriate loader to handle this file type.
|
| return (
> <div class={statusBarClassNames} aria-hidden={isHidden}>
| <div class={progressClassNames}
| style={{ width: width + '%' }}
Whenever I try to import a UI element these errors pop up. I’m totally stuck, does anybody have an idea what the issue might be? Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
webpack issue when trying to render in reactjs - Stack Overflow
Hi I am a newbie in react js and was trying to build an quiz application..When trying to do so I am getting...
Read more >Using Webpack with React, Pt. 1 - Toptal
In this Webpack tutorial, we demystify Webpack/React configuration. Go beyond Create React App with Webpack customization tailored to the needs of your app....
Read more >How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >The best webpack configurations for React applications
If you're like me, then you've struggled with configuring webpack for your React app. Create React App (CRA) ships with webpack already under ......
Read more >Optimizing Performance - React
If you're benchmarking or experiencing performance problems in your React apps, make sure you're testing with the minified production build.
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 Free
Top 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
@goto-bus-stop you were spot on, removing that key made the import work. Thank you! (I now have a new issue with the Uppy() component for which I will open a new issue.)
It should be including lib/StatusBar.js, not src/StatusBar.js. The problem is probably that we’re using
jsnext:main
incorrectly in our package.json. You’ve probably configured webpack to use that as a main field?We should remove the
jsnext:main
keys from our own package.json files. In the mean time, you could remove ‘jsnext:main’ from the list ofresolve.mainFields
in your webpack config to work around the issue.