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

Error with Babel in versions 1.2.8 and 1.2.9

Open naml14 opened this issue 1 year ago • 3 comments

When running in development mode with Vite, any of the versions mentioned in the title causes the following error related to the Babel dependency:

Could not resolve "babel-runtime/helpers/inherits"

    node_modules/react-lottie/dist/index.js:27:25:
      27 │ var _inherits2 = require('babel-runtime/helpers/inherits');
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "babel-runtime/helpers/inherits" as external to exclude it from the bundle,
  which will remove this error and leave the unresolved path in the bundle. You can also surround
  this "require" call with a try/catch block to handle this failure at run-time instead of
  bundle-time.

Please review this dependency. I suggest checking out the new features of Babel, as many things have changed, and some functionalities may have been deprecated.

naml14 avatar Nov 26 '24 20:11 naml14

When running in development mode with Vite, any of the versions mentioned in the title causes the following error related to the Babel dependency:

Could not resolve "babel-runtime/helpers/inherits"

    node_modules/react-lottie/dist/index.js:27:25:
      27 │ var _inherits2 = require('babel-runtime/helpers/inherits');
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "babel-runtime/helpers/inherits" as external to exclude it from the bundle,
  which will remove this error and leave the unresolved path in the bundle. You can also surround
  this "require" call with a try/catch block to handle this failure at run-time instead of
  bundle-time.

Please review this dependency. I suggest checking out the new features of Babel, as many things have changed, and some functionalities may have been deprecated.

Me too: "react-lottie": "^1.2.3"

ashen114 avatar Nov 28 '24 02:11 ashen114

When running in development mode with Vite, any of the versions mentioned in the title causes the following error related to the Babel dependency:

Could not resolve "babel-runtime/helpers/inherits"

    node_modules/react-lottie/dist/index.js:27:25:
      27 │ var _inherits2 = require('babel-runtime/helpers/inherits');
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "babel-runtime/helpers/inherits" as external to exclude it from the bundle,
  which will remove this error and leave the unresolved path in the bundle. You can also surround
  this "require" call with a try/catch block to handle this failure at run-time instead of
  bundle-time.

Please review this dependency. I suggest checking out the new features of Babel, as many things have changed, and some functionalities may have been deprecated.

I install babel-runtime in dependencies then fixed it; Here are some comments:https://github.com/babel/babel/issues/10584#issuecomment-544725354

ashen114 avatar Nov 28 '24 07:11 ashen114

Hi @ashen114 @naml14 @larixk @tpae bebel-runtime is back in [email protected]

chenqingspring avatar Nov 30 '24 08:11 chenqingspring

@chenqingspring Issue is also to be closed

ibakirov avatar Jul 01 '25 12:07 ibakirov