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.

Issue with React component and webpack

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hscharitzercommented, Jan 15, 2019

@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.)

1reaction
goto-bus-stopcommented, Jan 15, 2019

ERROR in ./node_modules/@uppy/status-bar/src/StatusBar.js 117:4

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 of resolve.mainFields in your webpack config to work around the issue.

Read more comments on GitHub >

github_iconTop 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 >

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