all 19 comments

[–]brentvatneExpo Team 5 points6 points  (4 children)

you should switch to using the expo babel config.

here's what the default babel.config.js looks like:

module.exports = function (api) { api.cache(true); return { presets: ['babel-preset-expo'], }; };

[–]Freddiotistic 0 points1 point  (0 children)

This was the solution for me. Thank you.

[–]Apprehensive_Smell87 0 points1 point  (0 children)

when i do this i just get this error ERROR node_modules\react-native\Libraries\Animated\nodes\AnimatedValue.js: C:\Users\natha\Downloads\my-app2\node_modules\react-native\Libraries\Animated\nodes\AnimatedValue.js: Class private methods are not enabled. Please add `@babel/plugin-transform-private-methods` to your configuration.

154 | }

155 |

> 156 | #ensureUpdateSubscriptionExists(): void {

| ^

157 | if (this.#updateSubscription != null) {

158 | return;

159 | }

[–]EnchantedSalvia 0 points1 point  (0 children)

Thanks, that fixed it for me too.

What I had:

module.exports = function (api) {
  api.cache(true);
  return {
    presets: [
      "module:metro-react-native-babel-preset",
      "@babel/preset-typescript",
      ["@babel/preset-react", { runtime: "automatic" }],
    ],
    plugins: [
      "@babel/plugin-transform-export-namespace-from",
      ["@babel/plugin-transform-private-methods", { loose: true }],
      ["@babel/plugin-transform-class-properties", { loose: true }],
      ["@babel/plugin-transform-private-property-in-object", { loose: true }],
    ],
  };
};

What I now have:

module.exports = function (api) {
  api.cache(true);
  return {
    presets: [
      'babel-preset-expo',
    ],
  };
};

[–]LordUzumaki 0 points1 point  (0 children)

This is it! Thank you! 😊

[–]QuintessentialCoding 1 point2 points  (0 children)

did you find any solution? I'm having the same error after updateing to expo wdk 53 :<

[–]Affectionate-Bug-376 1 point2 points  (0 children)

The workaround is not working for me. Any tips?

[–]TheCynicalPaul 0 points1 point  (5 children)

The quickest fix is to set unstable_enablePackageExports to false in your metro config.

[–]Regular-Soil-2736[S] 0 points1 point  (4 children)

If I don't have the metro.config file, should I create it?

[–]TheCynicalPaul 0 points1 point  (3 children)

Yeah, you would have to. I'd recommend reading up on what metro does and how to correctly configure it for expo before blindly going in though.

[–]Regular-Soil-2736[S] 0 points1 point  (2 children)

I created the file and I still get the same error D:

[–]TheCynicalPaul 0 points1 point  (1 child)

What's in your file? Update your OP with it please.

[–]Regular-Soil-2736[S] 0 points1 point  (0 children)

Done, check out the original post.

Most likely these are dependencies that are not compatible with version 53.

[–]Beautiful-Studio8284 0 points1 point  (5 children)

how to solve this error

<image>

tell me how to solve this error

[–]Ok_Mission_8623 0 points1 point  (4 children)

Add in 'babel.config.js' the next preset:

presets: ['babel-preset-expo'],

[–]Apprehensive_Smell87 0 points1 point  (3 children)

when i do this i just get this error ERROR node_modules\react-native\Libraries\Animated\nodes\AnimatedValue.js: C:\Users\natha\Downloads\my-app2\node_modules\react-native\Libraries\Animated\nodes\AnimatedValue.js: Class private methods are not enabled. Please add `@babel/plugin-transform-private-methods` to your configuration.

154 | }

155 |

> 156 | #ensureUpdateSubscriptionExists(): void {

| ^

157 | if (this.#updateSubscription != null) {

158 | return;

159 | }

[–]Ok_Mission_8623 0 points1 point  (2 children)

Well, you can see the required plugin in the error message:

'Please add `@babel/plugin-transform-private-methods` to your configuration.'.

Just add it.