react-lottie icon indicating copy to clipboard operation
react-lottie copied to clipboard

babel-runtime is throwing an error while running npm run build

Open prachit07 opened this issue 1 year ago • 12 comments

After upgrading babel-runtime, my project is now throwing an error in npm run build, similar to this issue, https://github.com/chenqingspring/react-lottie/issues/166#issuecomment-2489852597

$ next build
  ▲ Next.js 14.2.18
  - Environments: .env.local

   Creating an optimized production build ...
Failed to compile.

./node_modules/react-lottie/dist/index.js
Module not found: Can't resolve 'babel-runtime/helpers/extends'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./components/templates/GiftCard/GiftCardOrderSuccess/index.tsx

./node_modules/react-lottie/dist/index.js
Module not found: Can't resolve 'babel-runtime/core-js/object/get-prototype-of'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./components/templates/GiftCard/GiftCardOrderSuccess/index.tsx

./node_modules/react-lottie/dist/index.js
Module not found: Can't resolve 'babel-runtime/helpers/classCallCheck'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./components/templates/GiftCard/GiftCardOrderSuccess/index.tsx

./node_modules/react-lottie/dist/index.js
Module not found: Can't resolve 'babel-runtime/helpers/createClass'

https://nextjs.org/docs/messages/module-not-found

prachit07 avatar Nov 21 '24 10:11 prachit07

I started having the same issue with Next 13 as well, with no idea which sub-dependency changed to break react-lottie.

Edit: I solved by manually installing babel-runtime on next or the sub-package of my project that uses react-lottie

rafaelmoni avatar Nov 21 '24 17:11 rafaelmoni

@rafaelmoni @babel/runtime is removed in v1.2.9, package is no need to depend on it. upgrade to see if the error still exist.

chenqingspring avatar Nov 22 '24 03:11 chenqingspring

I have the same issue after upgrading to v1.2.9

prachit07 avatar Nov 22 '24 04:11 prachit07

I have the same issue after upgrading to v1.2.9

@prachit07 please fix it with npm install --save babel-runtime

chenqingspring avatar Nov 22 '24 06:11 chenqingspring

@chenqingspring babel-runtime error started throwing error since v1.2.8.

Installing v1.2.9 and npm install --save babel-runtime resolves issue with build, but [email protected] has potential issues

ibakirov avatar Nov 22 '24 07:11 ibakirov

@ibakirov [email protected] is deprecated for 7 years. how about use npm install --save @babel/runtime or I'll think about other solutions.

chenqingspring avatar Nov 22 '24 08:11 chenqingspring

For the time being use "react-lottie": "1.2.6" . Important to remove ^

rajeevbbqq avatar Nov 23 '24 16:11 rajeevbbqq

@rajeevbbqq yes, I did for now with 1.2.6.

@chenqingspring I will check with @babel/runtime

ibakirov avatar Nov 23 '24 17:11 ibakirov

@chenqingspring I have checked installing 1.2.9 and npm install --save @babel/runtime which installs 7.26.0 and error building still exists since react-lottie can't find:

  • Module not found: Can't resolve 'babel-runtime/helpers/extends'
  • Module not found: Can't resolve 'babel-runtime/core-js/object/get-prototype-of'
  • Module not found: Can't resolve 'babel-runtime/helpers/classCallCheck'
  • Module not found: Can't resolve 'babel-runtime/helpers/createClass'
  • Module not found: Can't resolve 'babel-runtime/helpers/possibleConstructorReturn'
  • Module not found: Can't resolve 'babel-runtime/helpers/inherits'

ibakirov avatar Nov 26 '24 15:11 ibakirov

add bebel-runtime back on [email protected]

chenqingspring avatar Nov 30 '24 08:11 chenqingspring

hi @ibakirov, bebel-runtime is back in [email protected]

chenqingspring avatar Nov 30 '24 08:11 chenqingspring

@chenqingspring Thank you, in version 1.2.10 it's working fine!

ibakirov avatar Apr 03 '25 19:04 ibakirov

@chenqingspring Maybe time to close the issue?

ibakirov avatar Jul 01 '25 12:07 ibakirov