javascriptreactjsfirebasebabeljscodesandbox

Could not find/install babel plugin 'proposal-decorators' on CodeSandbox with Firebase


I'm trying to use Codesandbox in React project, but I'm stuck with error: Could not find/install babel plugin 'proposal-decorators': Cannot find plugin 'proposal-decorators' or 'babel-plugin-proposal-decorators'. Error happens when I adding firebase utility in the project. On my local machine everythings fine. Here is my code: https://codesandbox.io/s/eloquent-sun-r1bcqv

I tried to:

  1. Install babel/plugin-proposal-decorators and add "@babel/plugin-proposal-decorators": "7.18.2" in dependencies of package.json
  2. Install babel and add "babel": "6.23.0" in dependencies of package.json
  3. Create babel.confing.json file and add {"plugins": ["@babel/plugin-proposal-decorators"]} into that config

What cause the problem? Why there is babel/plugin-proposal-decorators if I didn't add it?


Solution

  • It's because of importing SVG as a ReactComponent. It can't be done in sandboxes.