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:
- Install babel/plugin-proposal-decorators and add
"@babel/plugin-proposal-decorators": "7.18.2"
in dependencies of package.json - Install babel and add
"babel": "6.23.0"
in dependencies of package.json - 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?
Advertisement
Answer
It’s because of importing SVG as a ReactComponent. It can’t be done in sandboxes.