Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Expo config plugin in v4.3.0 #1081

Open
6 tasks done
KimmoHernborg opened this issue Feb 14, 2025 · 13 comments
Open
6 tasks done

Invalid Expo config plugin in v4.3.0 #1081

KimmoHernborg opened this issue Feb 14, 2025 · 13 comments
Labels
bug This points to a verified bug in the code

Comments

@KimmoHernborg
Copy link

Checklist

Description

When running expo install react-native-auth0 or expo prebuild I get the following error message:

CommandError: Package "react-native-auth0" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'

Cannot create a working build with version 4.3.0, but earlier versions work.

Reproduction

  1. Install version v4.3.0 (latest at the time of writing) into project expo install react-native-auth0
CommandError: Package "react-native-auth0" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'
  1. Prebuild to update native folders expo prebuild
CommandError: Package "react-native-auth0" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'
  1. Trying to run either a expo run:ios or expo run:android fails with the following error:
The following build commands failed:
        PhaseScriptExecution [CP-User]\ Generate\ app.config\ for\ prebuilt\ Constants.manifest /path/00LoginExpo-dpxholqrmdwopgdlraqemjiyijwe/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXConstants.build/Script-46EB2E00016BE0.sh (in target 'EXConstants' from project 'Pods')
        Building workspace 00LoginExpo with scheme 00LoginExpo and configuration Debug

Additional context

Tested and recreated in an updated 00-Login-Expo project (updated to newer version of Expo)

react-native-auth0 version

v4.3.0

React Native version

0.74.5

Expo version

51.0.39

Platform

iOS

Platform version(s)

18.2

@KimmoHernborg KimmoHernborg added the bug This points to a verified bug in the code label Feb 14, 2025
@andyconchubhair
Copy link

I encountered the same issue with 4.4.0 using react native 0.73.6. Installing 4.2.0 works

@irinagastmaier
Copy link

Any updates on this issue? I’m experiencing the same problem with versions 4.3 and 4.4. The only version that works for me is 4.2 on Expo 51 with React Native 0.74.5.

@poovamraj
Copy link
Contributor

Hey folks, we are looking into this. We will get back ASAP, sorry on the inconvenience

@subhankarmaiti
Copy link

I've dug into the issue and it appears the problem is related to the version of Expo CLI. As noted in the Expo changelog, recent updates have resolved this problem. Instead of using a locally installed Expo CLI, please try using the latest version via npx. For example, you can run:

npx expo prebuild

This command ensures you’re using the most up-to-date Expo CLI, which should address the issue reported here. Let me know if you run into any further problems!

@Dakuan
Copy link

Dakuan commented Feb 27, 2025

not working for me either locally or on my EAS builds...

@subhankarmaiti
Copy link

Interesting, @Dakuan can you share the output of

npx expo -v

@Dakuan
Copy link

Dakuan commented Feb 27, 2025

0.18.31

and EAS:

yarn run v1.22.21
$ /Users/expo/workingdir/build/node_modules/.bin/expo prebuild --no-install --platform ios
The ios project is malformed, project files will be cleared and reinitialized.
- Clearing ios
✔ Cleared ios code
CommandError: Package "react-native-auth0" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin
Cannot use import statement outside a module
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn expo prebuild --no-install --platform ios exited with non-zero code: 1

@subhankarmaiti
Copy link

subhankarmaiti commented Feb 28, 2025

@Dakuan seems like you are using the old version of expo cli. You should use the latest version 0.22.18.

@Dakuan
Copy link

Dakuan commented Feb 28, 2025

and eas?

@KimmoHernborg
Copy link
Author

KimmoHernborg commented Feb 28, 2025

@Dakuan seems like you are using the old version of expo cli. You should use the latest version 0.22.18.

The version of the Expo CLI is connected to the version of Expo you are using in the project. My project is using Expo version 51.0.39 and the Expo CLI version 0.18.31. You need to support earlier version of Expo CLI, not everyone can be on the latest version of Expo, and it is not feasible to upgrade the project just to get the latest version of Expo CLI.

@Robspin
Copy link

Robspin commented Mar 2, 2025

Using the latest expo CLI and EAS fixed it for me.

@poovamraj
Copy link
Contributor

@Dakuan, as @Robspin mentioned you can try the latest version of EAS CLI - 15.0.12

@poovamraj
Copy link
Contributor

poovamraj commented Mar 3, 2025

@KimmoHernborg you are right, Expo since 46 uses "Local Expo CLI" but as mentioned in their announcement - https://blog.expo.dev/the-new-expo-cli-f4250d8e3421

This does mean if you need a CLI bug fix, you’ll either need to update your expo package version or force the CLI version with Yarn resolutions in the package.json:

{
  "resolutions": {
    "@expo/cli": "xxx" 
  }
}

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

7 participants