react-power-select icon indicating copy to clipboard operation
react-power-select copied to clipboard

Create React App 2 Build Error

Open SCasarotto opened this issue 7 years ago • 3 comments
trafficstars

Hey @selvagsz,

I updated one of my projects to CRA2 and was attempting to build. Received the following error:

Failed to minify the bundle. Error: static/js/1.fa0b5eff.chunk.js from Terser

From there I started into my project to try to narrow down what was causing this error. After isolating this more, it looks like it is this package. To prove this to myself I set up a blank app and received the same error.

Steps to reproduce:

  1. npx create-react-app my-app
  2. cd my-app
  3. yarn add react-power-select
  4. in /src/App.js add import { PowerSelect } from 'react-power-select'
  5. yarn build

I am also going to post about this in CRA but figured if it is something that has to be fixed here I would give you aheads up. (https://github.com/facebook/create-react-app/issues/5250)

Will keep you posted.

SCasarotto avatar Oct 02 '18 15:10 SCasarotto

Thanks for reporting @SCasarotto . As I read up, I see the issue is related to Terser bug unable to handle func defined inside else clause (which exists in https://github.com/HubSpot/tether/commit/4ca3d2e3cfec04549b8bc7ce426d2c14c2e393d5#diff-16aa9b816bdda8647812b6bd5bdfcffaR1256)

https://github.com/facebook/create-react-app/issues/5250#issuecomment-426531667

selvagsz avatar Oct 03 '18 08:10 selvagsz

Tested and appears to be fixed. https://github.com/facebook/create-react-app/pull/5281 https://github.com/facebook/create-react-app/issues/5250#event-1882851688

SCasarotto avatar Oct 03 '18 20:10 SCasarotto

This is still a bug, we just masked it. I'd leave this open for tracking.

Timer avatar Oct 04 '18 02:10 Timer