`@babel/plugin-proposal-decorators` is not supported in `hermes-parser` - was: Broken babel preset setup with @babel/plugin-proposal-decorators and React Native 0.76.0 #1549
Since i upgraded from react-native 0.75.4 to 0.76 and the babel plugin "@babel/plugin-proposal-decorators" stopped working.
What we know:
I was not able to fix the issue by changing babel or @babel/plugin-proposal-decorators versions so probably is not something with babel setup.
I can confirm that brand new react-native 0.76.0 can not work with @babel/plugin-proposal-decorators as we can see on the reproducer.
The reproducer is a standard react-native 0.76.0 with "@babel/plugin-proposal-decorators": "^7.25.9" and a babel.config.js that i believe most of the users configure.
The reproducer can be found on:
https://github.com/lucaswitch/broken-babel-preset
I understand that it's not a problem of react-native project but is something that we can probably can be adjusted on the official babel preset.
Actually this plugin is used by a lot of developers including me and a lot of libraries need that configuration to be able to be used on a react-native project.
Steps to reproduce
I tested this issue only on IOS but i think it's not related to any platform since is a babel related problem.
I'm not a babel expert but i suspect there is something on @react-native/babel-preset that broke this configuration.
Created a little repro with a brand new bare react-native project and an small minimal decorator setup just to prove that is not transforming js syntax the right way on react-native.
Description
Since i upgraded from react-native 0.75.4 to 0.76 and the babel plugin "@babel/plugin-proposal-decorators" stopped working.
What we know:
I was not able to fix the issue by changing babel or @babel/plugin-proposal-decorators versions so probably is not something with babel setup. I can confirm that brand new react-native 0.76.0 can not work with @babel/plugin-proposal-decorators as we can see on the reproducer.
The reproducer is a standard react-native 0.76.0 with "@babel/plugin-proposal-decorators": "^7.25.9" and a babel.config.js that i believe most of the users configure. The reproducer can be found on: https://github.com/lucaswitch/broken-babel-preset
I understand that it's not a problem of react-native project but is something that we can probably can be adjusted on the official babel preset. Actually this plugin is used by a lot of developers including me and a lot of libraries need that configuration to be able to be used on a react-native project.
Steps to reproduce
I tested this issue only on IOS but i think it's not related to any platform since is a babel related problem.
I'm not a babel expert but i suspect there is something on @react-native/babel-preset that broke this configuration. Created a little repro with a brand new bare react-native project and an small minimal decorator setup just to prove that is not transforming js syntax the right way on react-native.
React Native Version
0.76.0
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/lucaswitch/broken-babel-preset
Screenshots and Videos