react-lottie
react-lottie copied to clipboard
babel-runtime is throwing an error while running npm run build
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
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 @babel/runtime is removed in v1.2.9, package is no need to depend on it. upgrade to see if the error still exist.
I have the same issue after upgrading to v1.2.9
I have the same issue after upgrading to v1.2.9
@prachit07 please fix it with npm install --save babel-runtime
@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 [email protected] is deprecated for 7 years. how about use npm install --save @babel/runtime
or I'll think about other solutions.
For the time being use "react-lottie": "1.2.6" . Important to remove ^
@rajeevbbqq yes, I did for now with 1.2.6.
@chenqingspring I will check with @babel/runtime
@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'
add bebel-runtime back on [email protected]
hi @ibakirov, bebel-runtime is back in [email protected]
@chenqingspring Thank you, in version 1.2.10 it's working fine!
@chenqingspring Maybe time to close the issue?