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.

Is Electron supported?

See original GitHub issue

I am trying to use this library in my Electron app. However, simply using

function CropDemo({ src }) {
  const [crop, setCrop] = useState({ aspect: 16 / 9 });
  return <ReactCrop src={src} crop={crop} onChange={newCrop => setCrop(newCrop)} />;
}

did not work in Electron. As seen below, only an orange frame was displayed around the image and I was not able to crop it.

https://user-images.githubusercontent.com/24484961/114254006-f7463280-99e7-11eb-8dbf-cd08b1032be6.mov

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
virinchi-manepalli-trysolviocommented, Jun 17, 2021

@sogoogos @DominicTobias I resolved this issue. react image cropper supports electron. the issue is from web packs. CSS-loader and style-loader should be in dev dependencies. just do yarn remove CSS-loader and style-loader and do yarn add -D CSS-loader make sure to add CSS-loader in webpack in this manner

 module: {
    rules: [
      {
        test: /\.(js|ts|tsx)$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
        },
      },
      {
        test: /\.css$/i,
        use: ['style-loader', 'css-loader'],
      },
    ],
  },
1reaction
DominicTobiascommented, Jun 14, 2021

Thanks for finding a fix @virinchi-manepalli-trysolvio , since the issue was related to loading the CSS correctly going to close this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron Support
The latest three stable major versions are supported by the Electron team. For example, if the latest release is 6.1.x, then the 5.0.x...
Read more >
Electron
Release Released Supported 22 3 weeks and 3 days ago. (29 Nov 2022) Ends in 6 months. (07 Jul 2023) 21 2 months and 4...
Read more >
Electron (software framework)
Electron is a free and open-source software framework developed and maintained by GitHub. ... The latest three stable version are support by the...
Read more >
What is minimum system requirements to run electron apps?
Only 64bit binaries are provided for macOS, and the minimum macOS version supported is macOS 10.10 (Yosemite).
Read more >
What Is Electron and Why Is It So Polarizing?
At the most basic level, Electron is a full-blown app building framework that allows you to build desktop apps using web technologies. What...
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