Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prachit07 opened this issue Nov 21, 2024 · 11 comments
Open

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

prachit07 opened this issue Nov 21, 2024 · 11 comments

Comments

@prachit07
Copy link

After upgrading babel-runtime, my project is now throwing an error in npm run build, similar to this issue, #166 (comment)

$ 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

@rafaelmoni
Copy link

rafaelmoni commented Nov 21, 2024

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

@chenqingspring
Copy link
Owner

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

@prachit07
Copy link
Author

prachit07 commented Nov 22, 2024

I have the same issue after upgrading to v1.2.9

@chenqingspring
Copy link
Owner

I have the same issue after upgrading to v1.2.9

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

@ibakirov
Copy link

@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

@chenqingspring
Copy link
Owner

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

@rajeevbbqq
Copy link

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

@ibakirov
Copy link

@rajeevbbqq yes, I did for now with 1.2.6.

@chenqingspring I will check with @babel/runtime

@ibakirov
Copy link

@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'

@chenqingspring
Copy link
Owner

add bebel-runtime back on [email protected]

@chenqingspring
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants