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

expo in monorepo - fresh install error: expected hoisted manifest for \"metro-react-native-babel-preset#@babel/core#@babel/helper-compilation-targets#browserslist\" #16153

Closed
i8ramin opened this issue Feb 1, 2022 · 9 comments
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues needs validation Issue needs to be validated

Comments

@i8ramin
Copy link

i8ramin commented Feb 1, 2022

Summary

Adding a new expo project to an existing monorepo by following the docs here. this is a fresh install using the blank project with TS. when running yarn install, getting the following error:

error An unexpected error occurred: "expected hoisted manifest for \"metro-react-native-babel-preset#@babel/core#@babel/helper-compilation-targets#browserslist\"".

Removing yarn.lock and issuing yarn install does seem to solve the problem, but that is not a viable option for us. Any ideas what could be causing this?

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android, iOS, Web

SDK Version (managed workflow only)

No response

Environment

❯ expo diagnostics

  Expo CLI 5.0.3 environment info:
    System:
      OS: macOS 12.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
      Yarn: 1.18.0 - /opt/homebrew/bin/yarn
      npm: 8.1.0 - /opt/homebrew/bin/npm
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    IDEs:
      Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
    npmGlobalPackages:
      expo-cli: 5.0.3
    Expo Workflow: managed

Reproducible demo

> expo init packages/mobile --no-install --yarn

# followed instructions at https://docs.expo.dev/guides/monorepos/ and made appropriate changes

# from root of monorepo
> yarn install 

error An unexpected error occurred: "expected hoisted manifest for \"metro-react-native-babel-preset#@babel/core#@babel/helper-compilation-targets#browserslist\"".

info If you think this is a bug, please open a bug report with the information provided in "/Users/ramin/Work/carrot/yarn-error.log".

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@i8ramin i8ramin added the needs validation Issue needs to be validated label Feb 1, 2022
@i8ramin
Copy link
Author

i8ramin commented Feb 1, 2022

Not sure if is a true solution, but manually adding this to the expo package devDependencies seems to have fixed the issue (for now). will report back if it continues to happen after this:

  "devDependencies": {
    ....
    "metro-react-native-babel-preset": "~0.64.0",
  },

@brentvatne
Copy link
Member

hi there! i followed these instructions a couple days ago and had no issues. please share a reproducible example and we're happy to investigate!

@brentvatne brentvatne added the incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues label Feb 1, 2022
@expo-bot
Copy link
Collaborator

expo-bot commented Feb 1, 2022

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I've only been able to reproduce it in private, proprietary code"

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

@expo-bot expo-bot closed this as completed Feb 1, 2022
@ariccio
Copy link

ariccio commented Jun 19, 2022

No idea what's going on, but I'm hitting this same error when doing an expo upgrade. I had to discover (and turn on) the EXPO_DEBUG environment variable (expo upgrade apparently supports this, but is undocumented) to get the yarn error message:

An unexpected error occurred: "expected hoisted manifest for \"babel-preset-expo#metro-react-native-babel-preset#@babel/core#@babel/helper-compilation-targets#browserslist\"".

Let me see if I can work around this?

@ariccio
Copy link

ariccio commented Jun 19, 2022

@hirbod
Copy link
Contributor

hirbod commented Jun 22, 2022

I had a similar issue when I was trying to upgrade from SDK 44 to SDK 45.
I tried different approaches but what did just work fine for me was to delete yarn.lock and node_modules and hit "yarn" afterwards - thats it, bug was gone.

@flexbox
Copy link
Contributor

flexbox commented Feb 1, 2023

confirmed here as well

An unexpected error occurred: "expected hoisted manifest for \"metro-react-native-babel-transformer#@babel/core#@babel/helper-compilation-targets#browserslist\""

image

following @hirbod solution fixed the issue

here is a PR as an example flexbox/react-native-bootcamp@12cd8c4

@conoremclaughlin
Copy link

Same issue running expo upgrade or npx expo install --fix to get to v48. Fixed with @hirbod's solution.

@pranshuchittora
Copy link
Contributor

Was happening due to dep version mismatch.
These are the versions which has worked for me

    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.9",
    "@babel/preset-env": "^7.14.0",
    "babel-plugin-module-resolver": "^4.1.0",
    "metro-react-native-babel-preset": "^0.73.5"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues needs validation Issue needs to be validated
Projects
None yet
Development

No branches or pull requests

8 participants